diff --git a/.nais/nais-q0.yml b/.nais/nais-q0.yml
index ce7acdbdf1..0f08d5d3f9 100644
--- a/.nais/nais-q0.yml
+++ b/.nais/nais-q0.yml
@@ -153,6 +153,10 @@ spec:
value: "https://pdl-pip-api-q0.dev.intern.nav.no"
- name: PDL_PIP_SCOPE
value: "dev-fss:pdl:pdl-pip-api-q0"
+ - name: PDL_FULLMAKT_URL
+ value: "https://pdl-fullmakt.dev.intern.nav.no"
+ - name: PDL_FULLMAKT_SCOPE
+ value: "dev-fss:pdl:pdl-fullmakt"
- name: PERSONFORVALTER_URL
value: "https://pdl-web.dev.intern.nav.no/endreperson"
- name: OPPGAVE_BASEURL
diff --git a/.nais/nais-q1.yml b/.nais/nais-q1.yml
index d91c635654..776f0093ca 100644
--- a/.nais/nais-q1.yml
+++ b/.nais/nais-q1.yml
@@ -157,6 +157,10 @@ spec:
value: "https://pdl-pip-api-q1.dev.intern.nav.no"
- name: PDL_PIP_SCOPE
value: "dev-fss:pdl:pdl-pip-api-q1"
+ - name: PDL_FULLMAKT_URL
+ value: "https://pdl-fullmakt.dev.intern.nav.no"
+ - name: PDL_FULLMAKT_SCOPE
+ value: "dev-fss:pdl:pdl-fullmakt"
- name: PERSONFORVALTER_URL
value: "https://pdl-web.dev.intern.nav.no/endreperson"
- name: OPPGAVE_BASEURL
diff --git a/.nais/nais.yml b/.nais/nais.yml
index f2b6e509cb..0094f025f7 100644
--- a/.nais/nais.yml
+++ b/.nais/nais.yml
@@ -151,6 +151,10 @@ spec:
value: "https://pdl-pip-api.intern.nav.no"
- name: PDL_PIP_SCOPE
value: "prod-fss:pdl:pdl-pip-api"
+ - name: PDL_FULLMAKT_URL
+ value: "https://pdl-fullmakt.intern.nav.no"
+ - name: PDL_FULLMAKT_SCOPE
+ value: "prod-fss:pdl:pdl-fullmakt"
- name: PERSONFORVALTER_URL
value: "https://pdl-web.intern.nav.no/endreperson"
- name: OPPGAVE_BASEURL
@@ -193,4 +197,4 @@ spec:
value: "production"
# TODO: Bruke ekte URL
- name: SKATTEETATEN_INNKREVINGSOPPDRAG_API_BASE_URL
- value: "https://api-test.sits.no"
\ No newline at end of file
+ value: "https://api-test.sits.no"
diff --git a/tjenestespesifikasjoner/pdl-api/src/main/resources/pdl/queries/hentPersondata.graphql b/tjenestespesifikasjoner/pdl-api/src/main/resources/pdl/queries/hentPersondata.graphql
index b175acb783..26fc3425b5 100644
--- a/tjenestespesifikasjoner/pdl-api/src/main/resources/pdl/queries/hentPersondata.graphql
+++ b/tjenestespesifikasjoner/pdl-api/src/main/resources/pdl/queries/hentPersondata.graphql
@@ -162,13 +162,6 @@ query hentPersondata($ident: ID!){
spraak
}
}
- fullmakt {
- motpartsPersonident
- motpartsRolle
- omraader
- gyldigFraOgMed
- gyldigTilOgMed
- }
telefonnummer {
landskode
nummer
diff --git a/tjenestespesifikasjoner/pdl-fullmakt-api/pom.xml b/tjenestespesifikasjoner/pdl-fullmakt-api/pom.xml
new file mode 100644
index 0000000000..a23e9ddb62
--- /dev/null
+++ b/tjenestespesifikasjoner/pdl-fullmakt-api/pom.xml
@@ -0,0 +1,85 @@
+
+
+ 4.0.0
+
+ no.nav.sbl.dialogarena
+ tjenestespesifikasjoner
+ dev
+
+
+ pdl-fullmakt-api
+
+
+ 17
+ 17
+
+
+
+
+ no.nav.common
+ rest
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
+
+ com.fasterxml.jackson.module
+ jackson-module-kotlin
+
+
+ org.jetbrains.kotlin
+ kotlin-stdlib-jdk8
+
+
+
+
+
+
+ org.openapitools
+ openapi-generator-maven-plugin
+
+
+ default
+
+ generate
+
+
+ ${project.basedir}/src/main/resources/pdl-fullmakt-api/openapi.json
+ kotlin
+ jvm-okhttp4
+ no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.generated
+ ${project.basedir}/../openapi-templates
+
+ original
+ jackson
+
+
+
+
+
+
+ org.jetbrains.kotlin
+ kotlin-maven-plugin
+
+
+ compile
+ process-sources
+
+ compile
+
+
+
+ ${project.build.directory}/generated-sources/openapi/src/main/kotlin
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tjenestespesifikasjoner/pdl-fullmakt-api/src/main/resources/pdl-fullmakt-api/openapi.json b/tjenestespesifikasjoner/pdl-fullmakt-api/src/main/resources/pdl-fullmakt-api/openapi.json
new file mode 100644
index 0000000000..2e6e81c597
--- /dev/null
+++ b/tjenestespesifikasjoner/pdl-fullmakt-api/src/main/resources/pdl-fullmakt-api/openapi.json
@@ -0,0 +1,1109 @@
+{
+ "openapi": "3.0.1",
+ "info": {
+ "title": "Fullmakt",
+ "description": "Dokumentasjon for pdl-fullmakt API.",
+ "contact": {
+ "name": "Team Representasjon",
+ "url": "https://repr-docs.dev.intern.nav.no/"
+ },
+ "version": "1.0"
+ },
+ "servers": [
+ {
+ "url": "https://pdl-fullmakt.dev.intern.nav.no",
+ "description": "Generated server url"
+ }
+ ],
+ "security": [
+ {
+ "Authorization": []
+ },
+ {
+ "Azure-OBO-Token": []
+ }
+ ],
+ "paths": {
+ "/api/internbruker/fullmektig": {
+ "post": {
+ "tags": [
+ "fullmakt-internal-controller"
+ ],
+ "summary": "internbruker: Get all fullmakt for fullmektig",
+ "operationId": "getFullmaktForFullmektig",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/FullmakIdentRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "404": {
+ "description": "Fullmakt not found",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "200": {
+ "description": "Fullmakt fetched",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "User lacks access",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "204": {
+ "description": "Success but no content for Fullmakt",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "Service unavailable",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "The security token is missing, has expired, or is invalid for other reasons",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/internbruker/fullmektig-historikk": {
+ "post": {
+ "tags": [
+ "fullmakt-internal-controller"
+ ],
+ "summary": "internbruker: Get all fullmakt for fullmektig with history",
+ "operationId": "getFullmaktWithHistoryForFullmektig",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/FullmakIdentRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Fullmakt fetched with history",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "User lacks access",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "204": {
+ "description": "Success but no content for Fullmakt",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Fullmakt with history not found",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "Service unavailable",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "The security token is missing, has expired, or is invalid for other reasons",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/internbruker/fullmaktsgiver": {
+ "post": {
+ "tags": [
+ "fullmakt-internal-controller"
+ ],
+ "summary": "internbruker: Get all fullmakt for fullmaktsgiver",
+ "operationId": "getFullmaktForFullmaktsgiver",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/FullmakIdentRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "404": {
+ "description": "Fullmakt not found",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "User lacks access",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "204": {
+ "description": "Success but no content for Fullmakt",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "Service unavailable",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "200": {
+ "description": "Fullmakt for fullmaktsgiver fetched",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "The security token is missing, has expired, or is invalid for other reasons",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/internbruker/fullmaktsgiver-historikk": {
+ "post": {
+ "tags": [
+ "fullmakt-internal-controller"
+ ],
+ "summary": "internbruker: Get all fullmakt for fullmaktsgiver with history",
+ "operationId": "getFullmaktWithHistoryForFullmaktsgiver",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/FullmakIdentRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "403": {
+ "description": "User lacks access",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "204": {
+ "description": "Success but no content for Fullmakt",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Fullmakt with history not found",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "Service unavailable",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "200": {
+ "description": "Fullmakt with history fetched",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "The security token is missing, has expired, or is invalid for other reasons",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetailsByFullmaktId"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/internal/unleash": {
+ "get": {
+ "tags": [
+ "unleash-actuators"
+ ],
+ "operationId": "unleash",
+ "responses": {
+ "200": {
+ "description": "OK"
+ }
+ }
+ }
+ },
+ "/internal/unleash-fullmakt": {
+ "get": {
+ "tags": [
+ "unleash-actuators"
+ ],
+ "operationId": "unleashFullmakt",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/internal/shutdown": {
+ "get": {
+ "tags": [
+ "nais-actuators"
+ ],
+ "operationId": "shutdown",
+ "responses": {
+ "200": {
+ "description": "OK"
+ }
+ }
+ }
+ },
+ "/api/fullmektig": {
+ "get": {
+ "tags": [
+ "fullmakt-controller"
+ ],
+ "summary": "Get all fullmakt for fullmektig",
+ "operationId": "getFullmaktForFullmektig_1",
+ "responses": {
+ "404": {
+ "description": "Fullmakt not found",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "200": {
+ "description": "Fullmakt fetched",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "User lacks access",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "204": {
+ "description": "Success but no content for Fullmakt",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "Service unavailable",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "The security token is missing, has expired, or is invalid for other reasons",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/fullmektig/tema": {
+ "get": {
+ "tags": [
+ "fullmakt-controller"
+ ],
+ "summary": "Get all fullmakt with område union for fullmektig ",
+ "operationId": "getFullmaktForFullmektigTema",
+ "responses": {
+ "204": {
+ "description": "Success but no content for Fullmakt with område union",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmektigTemaResponse"
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Fullmakt not found",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmektigTemaResponse"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "User lacks access",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmektigTemaResponse"
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmektigTemaResponse"
+ }
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "Service unavailable",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmektigTemaResponse"
+ }
+ }
+ }
+ }
+ },
+ "200": {
+ "description": "Fullmakt fetched with område union",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmektigTemaResponse"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "The security token is missing, has expired, or is invalid for other reasons",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmektigTemaResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/fullmektig/temaMedHandling": {
+ "get": {
+ "tags": [
+ "fullmakt-controller"
+ ],
+ "operationId": "getFullmaktForFullmektigTemaMedHandling",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmektigTemaMedHandlingResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/fullmaktsgiver": {
+ "get": {
+ "tags": [
+ "fullmakt-controller"
+ ],
+ "summary": "Get all fullmakt for fullmaktsgiver",
+ "operationId": "getFullmaktForFullmaktsgiver_1",
+ "responses": {
+ "404": {
+ "description": "Fullmakt not found",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "200": {
+ "description": "Fullmakt fetched",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "User lacks access",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "204": {
+ "description": "Success but no content for Fullmakt",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "Service unavailable",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "The security token is missing, has expired, or is invalid for other reasons",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktDetails"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "FullmakIdentRequest": {
+ "type": "object",
+ "properties": {
+ "ident": {
+ "type": "string"
+ }
+ }
+ },
+ "FullmaktDetails": {
+ "type": "object",
+ "properties": {
+ "fullmaktId": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "registrert": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "registrertAv": {
+ "type": "string"
+ },
+ "endret": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "endretAv": {
+ "type": "string"
+ },
+ "opphoert": {
+ "type": "boolean"
+ },
+ "fullmaktsgiver": {
+ "type": "string"
+ },
+ "fullmektig": {
+ "type": "string"
+ },
+ "omraade": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OmraadeMedHandling"
+ }
+ },
+ "gyldigFraOgMed": {
+ "type": "string",
+ "format": "date"
+ },
+ "gyldigTilOgMed": {
+ "type": "string",
+ "format": "date"
+ },
+ "fullmaktUuid": {
+ "type": "string",
+ "format": "uuid"
+ },
+ "opplysningsId": {
+ "type": "string",
+ "format": "uuid"
+ },
+ "endringsId": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "status": {
+ "type": "string"
+ },
+ "kilde": {
+ "type": "string"
+ },
+ "fullmaktsgiverNavn": {
+ "type": "string"
+ },
+ "fullmektigsNavn": {
+ "type": "string"
+ }
+ }
+ },
+ "OmraadeMedHandling": {
+ "type": "object",
+ "properties": {
+ "tema": {
+ "type": "string"
+ },
+ "handling": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "LES",
+ "KOMMUNISER",
+ "SKRIV"
+ ]
+ }
+ }
+ }
+ },
+ "FullmaktEndringsloggDetails": {
+ "type": "object",
+ "properties": {
+ "fullmaktEndringsloggId": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "fullmaktId": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "registrert": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "registrertAv": {
+ "type": "string"
+ },
+ "endret": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "endretAv": {
+ "type": "string"
+ },
+ "opphoert": {
+ "type": "boolean"
+ },
+ "fullmaktsgiver": {
+ "type": "string"
+ },
+ "fullmektig": {
+ "type": "string"
+ },
+ "omraade": {
+ "type": "string"
+ },
+ "gyldigFraOgMed": {
+ "type": "string",
+ "format": "date"
+ },
+ "gyldigTilOgMed": {
+ "type": "string",
+ "format": "date"
+ },
+ "fullmaktUuid": {
+ "type": "string",
+ "format": "uuid"
+ },
+ "opplysningsId": {
+ "type": "string",
+ "format": "uuid"
+ },
+ "endringsId": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "fullmaktsgiverNavn": {
+ "type": "string"
+ },
+ "fullmektigsNavn": {
+ "type": "string"
+ },
+ "kilde": {
+ "type": "string"
+ },
+ "kommentar": {
+ "type": "string"
+ }
+ }
+ },
+ "FullmaktEndringsloggDetailsByFullmaktId": {
+ "type": "object",
+ "properties": {
+ "fullmaktId": {
+ "type": "string"
+ },
+ "fullmaktEndringsloggDetails": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FullmaktEndringsloggDetails"
+ }
+ }
+ }
+ },
+ "FullmektigTemaResponse": {
+ "required": [
+ "fullmaktsgiver",
+ "fullmaktsgiverNavn",
+ "tema"
+ ],
+ "type": "object",
+ "properties": {
+ "fullmaktsgiver": {
+ "type": "string"
+ },
+ "tema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "fullmaktsgiverNavn": {
+ "type": "string"
+ }
+ }
+ },
+ "FullmektigTemaMedHandlingResponse": {
+ "required": [
+ "fullmaktsgiver",
+ "fullmaktsgiverNavn",
+ "omraade"
+ ],
+ "type": "object",
+ "properties": {
+ "fullmaktsgiver": {
+ "type": "string"
+ },
+ "omraade": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OmraadeMedHandlingResponse"
+ }
+ },
+ "fullmaktsgiverNavn": {
+ "type": "string"
+ }
+ }
+ },
+ "OmraadeMedHandlingResponse": {
+ "type": "object",
+ "properties": {
+ "tema": {
+ "type": "string"
+ },
+ "handling": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "securitySchemes": {
+ "Authorization": {
+ "type": "http",
+ "description": "Legg inn TOKENX token kun, uten \"Bearer \"",
+ "name": "Authorization",
+ "scheme": "bearer"
+ },
+ "Azure-OBO-Token": {
+ "type": "http",
+ "description": "Legg inn Azure OBO token kun, uten \"Bearer \"",
+ "name": "Azure-OBO-Token",
+ "scheme": "bearer"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/tjenestespesifikasjoner/pom.xml b/tjenestespesifikasjoner/pom.xml
index 0278a2864f..c6b0df16a5 100644
--- a/tjenestespesifikasjoner/pom.xml
+++ b/tjenestespesifikasjoner/pom.xml
@@ -44,6 +44,7 @@
oppfoelging-v1-tjenestespesifikasjon
pdl-pip-api
skatteetaten-innkreving-api
+ pdl-fullmakt-api
diff --git a/web/pom.xml b/web/pom.xml
index 651c06f2f2..921fbe1799 100644
--- a/web/pom.xml
+++ b/web/pom.xml
@@ -263,6 +263,11 @@
pdl-pip-api
${project.version}
+
+ no.nav.sbl.dialogarena
+ pdl-fullmakt-api
+ ${project.version}
+
no.nav.sbl.dialogarena
skatteetaten-innkreving-api
diff --git a/web/src/main/java/no/nav/modiapersonoversikt/consumer/pdlFullmakt/PdlFullmaktApi.kt b/web/src/main/java/no/nav/modiapersonoversikt/consumer/pdlFullmakt/PdlFullmaktApi.kt
new file mode 100644
index 0000000000..fef81c0975
--- /dev/null
+++ b/web/src/main/java/no/nav/modiapersonoversikt/consumer/pdlFullmakt/PdlFullmaktApi.kt
@@ -0,0 +1,48 @@
+package no.nav.modiapersonoversikt.consumer.pdlFullmaktApi
+
+import io.ktor.util.encodeBase64
+import no.nav.common.health.HealthCheckUtils
+import no.nav.common.health.selftest.SelfTestCheck
+import no.nav.common.types.identer.Fnr
+import no.nav.common.utils.UrlUtils
+import no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.generated.apis.FullmaktInternalControllerApi
+import no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.generated.models.FullmakIdentRequest
+import no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.generated.models.FullmaktDetails
+import no.nav.modiapersonoversikt.infrastructure.ping.Pingable
+import okhttp3.OkHttpClient
+import org.springframework.cache.annotation.CacheConfig
+import org.springframework.cache.annotation.Cacheable
+
+interface PdlFullmaktApi : Pingable {
+ fun hentFullmakterForFullmektig(fnr: Fnr): List?
+
+ fun hentFullmakterForFullmaktsgiver(fnr: Fnr): List?
+}
+
+@CacheConfig(cacheNames = ["pdlFullmaktCache"], keyGenerator = "userkeygenerator")
+open class PdlFullmaktApiImpl(
+ private val url: String,
+ private val client: OkHttpClient,
+) : PdlFullmaktApi {
+ private val pdlFullmaktApi = FullmaktInternalControllerApi(url, client)
+
+ @Cacheable
+ override fun hentFullmakterForFullmektig(fnr: Fnr): List? {
+ return pdlFullmaktApi.getFullmaktForFullmektig(fullmaktRequest(fnr.get()))
+ }
+
+ @Cacheable
+ override fun hentFullmakterForFullmaktsgiver(fnr: Fnr): List? {
+ return pdlFullmaktApi.getFullmaktForFullmaktsgiver(fullmaktRequest(fnr.get()))
+ }
+
+ private fun fullmaktRequest(ident: String) = FullmakIdentRequest(ident = ident.encodeBase64())
+
+ override fun ping() =
+ SelfTestCheck(
+ "pdl-fullmakt-api via $url",
+ false,
+ ) {
+ HealthCheckUtils.pingUrl(UrlUtils.joinPaths(url, "/internal/health/liveness"), client)
+ }
+}
diff --git a/web/src/main/java/no/nav/modiapersonoversikt/consumer/pdlFullmakt/PdlFullmaktConfig.kt b/web/src/main/java/no/nav/modiapersonoversikt/consumer/pdlFullmakt/PdlFullmaktConfig.kt
new file mode 100644
index 0000000000..8a4dee560e
--- /dev/null
+++ b/web/src/main/java/no/nav/modiapersonoversikt/consumer/pdlFullmakt/PdlFullmaktConfig.kt
@@ -0,0 +1,48 @@
+package no.nav.modiapersonoversikt.consumer.pdlFullmaktApi
+
+import no.nav.common.rest.client.RestClient
+import no.nav.common.token_client.client.OnBehalfOfTokenClient
+import no.nav.common.utils.EnvironmentUtils.getRequiredProperty
+import no.nav.modiapersonoversikt.infrastructure.AuthContextUtils
+import no.nav.modiapersonoversikt.infrastructure.http.AuthorizationInterceptor
+import no.nav.modiapersonoversikt.infrastructure.http.LoggingInterceptor
+import no.nav.modiapersonoversikt.infrastructure.http.XCorrelationIdInterceptor
+import no.nav.modiapersonoversikt.utils.DownstreamApi
+import no.nav.modiapersonoversikt.utils.bindTo
+import okhttp3.OkHttpClient
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+
+@Configuration
+open class PdlFullmaktConfig {
+ private val scope = DownstreamApi.parse(getRequiredProperty("PDL_FULLMAKT_SCOPE"))
+ private val url: String = getRequiredProperty("PDL_FULLMAKT_URL")
+
+ @Autowired
+ lateinit var tokenProvider: OnBehalfOfTokenClient
+
+ @Bean
+ open fun pdlPip(): PdlFullmaktApi {
+ val oboTokenProvider = tokenProvider.bindTo(scope)
+
+ val httpClient: OkHttpClient =
+ RestClient.baseClient().newBuilder()
+ .addInterceptor(XCorrelationIdInterceptor())
+ .addInterceptor(
+ LoggingInterceptor("PdlFullmaktApi") { request ->
+ requireNotNull(request.header("X-Correlation-ID")) {
+ "Kall uten \"X-Correlation-ID\" er ikke lov"
+ }
+ },
+ )
+ .addInterceptor(
+ AuthorizationInterceptor {
+ AuthContextUtils.requireBoundedClientOboToken(oboTokenProvider)
+ },
+ )
+ .build()
+
+ return PdlFullmaktApiImpl(url, httpClient)
+ }
+}
diff --git a/web/src/main/java/no/nav/modiapersonoversikt/infrastructure/http/OkHttpUtils.kt b/web/src/main/java/no/nav/modiapersonoversikt/infrastructure/http/OkHttpUtils.kt
index 6a0e8ca5d3..479bc96e80 100644
--- a/web/src/main/java/no/nav/modiapersonoversikt/infrastructure/http/OkHttpUtils.kt
+++ b/web/src/main/java/no/nav/modiapersonoversikt/infrastructure/http/OkHttpUtils.kt
@@ -171,8 +171,4 @@ class AuthorizationInterceptor(val tokenProvider: () -> String) : HeadersInterce
mapOf("Authorization" to "Bearer ${tokenProvider()}")
})
-class BasicAuthorizationInterceptor(private val username: String, private val password: String) : HeadersInterceptor({
- mapOf("Authorization" to Credentials.basic(username, password))
-})
-
fun getCallId(): String = MDC.get(MDCConstants.MDC_CALL_ID) ?: UUID.randomUUID().toString()
diff --git a/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataConfig.kt b/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataConfig.kt
index 8df22dd9f5..155cf2dad7 100644
--- a/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataConfig.kt
+++ b/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataConfig.kt
@@ -2,6 +2,7 @@ package no.nav.modiapersonoversikt.rest.persondata
import no.nav.modiapersonoversikt.consumer.krr.Krr
import no.nav.modiapersonoversikt.consumer.norg.NorgApi
+import no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.PdlFullmaktApi
import no.nav.modiapersonoversikt.consumer.skjermedePersoner.SkjermedePersonerApi
import no.nav.modiapersonoversikt.consumer.veilarboppfolging.ArbeidsrettetOppfolging
import no.nav.modiapersonoversikt.service.enhetligkodeverk.EnhetligKodeverk
@@ -23,9 +24,11 @@ open class PersondataConfig {
oppfolgingConfig: ArbeidsrettetOppfolging.Service,
policyEnforcementPoint: Kabac.PolicyEnforcementPoint,
kodeverk: EnhetligKodeverk.Service,
+ pdlFullmakt: PdlFullmaktApi,
): PersondataService {
return PersondataServiceImpl(
pdl,
+ pdlFullmakt,
krrService,
norgApi,
skjermedePersonerApi,
diff --git a/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataFletter.kt b/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataFletter.kt
index b5807e4788..a120ba5225 100644
--- a/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataFletter.kt
+++ b/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataFletter.kt
@@ -4,12 +4,13 @@ import no.nav.modiapersonoversikt.consumer.krr.Krr
import no.nav.modiapersonoversikt.consumer.norg.NorgDomain
import no.nav.modiapersonoversikt.consumer.pdl.generated.enums.AdressebeskyttelseGradering.*
import no.nav.modiapersonoversikt.consumer.pdl.generated.enums.ForelderBarnRelasjonRolle
-import no.nav.modiapersonoversikt.consumer.pdl.generated.enums.FullmaktsRolle
import no.nav.modiapersonoversikt.consumer.pdl.generated.enums.KjoennType
import no.nav.modiapersonoversikt.consumer.pdl.generated.enums.KontaktinformasjonForDoedsboSkifteform.ANNET
import no.nav.modiapersonoversikt.consumer.pdl.generated.enums.KontaktinformasjonForDoedsboSkifteform.OFFENTLIG
import no.nav.modiapersonoversikt.consumer.pdl.generated.enums.Sivilstandstype
import no.nav.modiapersonoversikt.consumer.pdl.generated.hentpersondata.*
+import no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.generated.models.FullmaktDetails
+import no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.generated.models.OmraadeMedHandling
import no.nav.modiapersonoversikt.consumer.veilarboppfolging.ArbeidsrettetOppfolging
import no.nav.modiapersonoversikt.rest.persondata.Persondata.asNavnOgIdent
import no.nav.modiapersonoversikt.rest.persondata.PersondataResult.InformasjonElement
@@ -31,6 +32,7 @@ class PersondataFletter(val kodeverk: EnhetligKodeverk.Service) {
data class Data(
val personIdent: String,
val persondata: Person,
+ val fullmektige: PersondataResult>,
val geografiskeTilknytning: PersondataResult,
val erEgenAnsatt: PersondataResult,
val navEnhet: PersondataResult,
@@ -94,7 +96,16 @@ class PersondataFletter(val kodeverk: EnhetligKodeverk.Service) {
foreldreansvar = hentForeldreansvar(data),
deltBosted = hentDeltBosted(data),
dodsbo = hentDodsbo(data),
- fullmakt = hentFullmakt(data),
+ fullmakt =
+ hentFullmakt(data).fold(
+ onSuccess = { it },
+ onNotRelevant = { emptyList() },
+ onFailure = { system, cause ->
+ feilendeSystemer.add(system.name)
+ Logging.secureLog.error("Persondata feilet system: $system", cause)
+ emptyList()
+ },
+ ),
vergemal = hentVergemal(data),
tilrettelagtKommunikasjon = hentTilrettelagtKommunikasjon(data),
telefonnummer = hentTelefonnummer(data),
@@ -828,30 +839,28 @@ class PersondataFletter(val kodeverk: EnhetligKodeverk.Service) {
)
}
- private fun hentFullmakt(data: Data): List {
- return data.persondata.fullmakt.map {
- val tredjepartsPerson =
- data.tredjepartsPerson.map { personer -> personer[it.motpartsPersonident] }.getOrNull()
- val navn = tredjepartsPerson?.navn
-
- Persondata.Fullmakt(
- motpartsPersonident = it.motpartsPersonident,
- motpartsPersonNavn = navn?.firstOrNull() ?: Persondata.Navn.UKJENT,
- motpartsRolle =
- when (it.motpartsRolle) {
- FullmaktsRolle.FULLMAKTSGIVER -> Persondata.FullmaktsRolle.FULLMAKTSGIVER
- FullmaktsRolle.FULLMEKTIG -> Persondata.FullmaktsRolle.FULLMEKTIG
- else -> Persondata.FullmaktsRolle.UKJENT
- },
- omrade = hentOmrade(it.omraader),
- gyldighetsPeriode = hentGyldighetsperiode(it.gyldigFraOgMed, it.gyldigTilOgMed),
- digitalKontaktinformasjonTredjepartsperson = tredjepartsPerson?.digitalKontaktinformasjon,
- )
+ private fun hentFullmakt(data: Data): PersondataResult> {
+ return data.fullmektige.map { fullmakter ->
+ fullmakter.map {
+ val tredjepartsPerson =
+ data.tredjepartsPerson.map { personer -> personer[it.fullmaktsgiver as String] }.getOrNull()
+ val navn = tredjepartsPerson?.navn
+
+ Persondata.Fullmakt(
+ motpartsPersonident = it.fullmaktsgiver as String,
+ motpartsPersonNavn = navn?.firstOrNull() ?: Persondata.Navn.UKJENT,
+ motpartsRolle = Persondata.FullmaktsRolle.FULLMEKTIG,
+ omrade = hentOmrade(it.omraade ?: emptyList()),
+ gyldighetsPeriode = hentGyldighetsperiode(it.gyldigFraOgMed, it.gyldigTilOgMed),
+ digitalKontaktinformasjonTredjepartsperson = tredjepartsPerson?.digitalKontaktinformasjon,
+ )
+ }
}
}
- private fun hentOmrade(omraader: List): List> {
- return omraader.map { omrade -> kodeverk.hentKodeBeskrivelse(Kodeverk.TEMA, omrade) }
+ // TODO: Legg ved informasjon om fullmaktens innsyn (LES,KOMMUNISER,SKRIV)
+ private fun hentOmrade(omraader: List): List> {
+ return omraader.map { omrade -> kodeverk.hentKodeBeskrivelse(Kodeverk.TEMA, omrade.tema as String) }
}
private fun hentVergemal(data: Data): List {
diff --git a/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataResult.kt b/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataResult.kt
index 1146c254c0..d9f30043bc 100644
--- a/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataResult.kt
+++ b/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataResult.kt
@@ -14,6 +14,7 @@ sealed class PersondataResult(val system: InformasjonElement) {
VEILEDER_ROLLER,
NORG_NAVKONTOR,
NORG_KONTAKTINFORMASJON,
+ FULLMAKT,
}
fun map(
diff --git a/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataService.kt b/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataService.kt
index 5fe59bc31b..0ac28b1bf5 100644
--- a/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataService.kt
+++ b/web/src/main/java/no/nav/modiapersonoversikt/rest/persondata/PersondataService.kt
@@ -7,6 +7,8 @@ import no.nav.modiapersonoversikt.consumer.norg.NorgApi
import no.nav.modiapersonoversikt.consumer.norg.NorgDomain
import no.nav.modiapersonoversikt.consumer.pdl.generated.HentPersondata
import no.nav.modiapersonoversikt.consumer.pdl.generated.hentpersondata.Person
+import no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.PdlFullmaktApi
+import no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.generated.models.FullmaktDetails
import no.nav.modiapersonoversikt.consumer.skjermedePersoner.SkjermedePersonerApi
import no.nav.modiapersonoversikt.consumer.veilarboppfolging.ArbeidsrettetOppfolging
import no.nav.modiapersonoversikt.infrastructure.tilgangskontroll.kabac.policies.TilgangTilBrukerMedKode6Policy
@@ -30,6 +32,7 @@ interface PersondataService {
class PersondataServiceImpl(
private val pdl: PdlOppslagService,
+ private val pdlFullmakt: PdlFullmaktApi,
private val krrService: Krr.Service,
private val norgApi: NorgApi,
private val skjermedePersonerApi: SkjermedePersonerApi,
@@ -65,9 +68,14 @@ class PersondataServiceImpl(
PersondataResult
.runCatching(InformasjonElement.VEILEDER_ROLLER) { hentTilganger() }
.getOrElse(PersondataService.Tilganger(kode6 = false, kode7 = false))
+
+ val fullmektige =
+ PersondataResult.runCatching(InformasjonElement.FULLMAKT) {
+ pdlFullmakt.hentFullmakterForFullmaktsgiver(Fnr(personIdent)) ?: emptyList()
+ }
val kontaktinformasjonTredjepartsperson =
PersondataResult.runCatching(InformasjonElement.DKIF_TREDJEPARTSPERSONER) {
- persondata
+ fullmektige
.findKontaktinformasjonTredjepartspersoner()
.associateWith { krrService.hentDigitalKontaktinformasjon(it) }
.mapValues { tredjepartspersonMapper.tilKontaktinformasjonTredjepartsperson(it.value) }
@@ -76,7 +84,7 @@ class PersondataServiceImpl(
val tredjepartsPerson =
PersondataResult.runCatching(InformasjonElement.PDL_TREDJEPARTSPERSONER) {
persondata
- .findTredjepartsPersoner()
+ .findTredjepartsPersoner(fullmektige.findKontaktinformasjonTredjepartspersoner())
.let { pdl.hentTredjepartspersondata(it) }
.mapNotNull {
tredjepartspersonMapper.lagTredjepartsperson(
@@ -104,6 +112,7 @@ class PersondataServiceImpl(
PersondataFletter.Data(
personIdent,
persondata,
+ fullmektige,
geografiskeTilknytning,
erEgenAnsatt,
navEnhet,
@@ -183,9 +192,8 @@ class PersondataServiceImpl(
}
}
- private fun Person.findTredjepartsPersoner(): List {
+ private fun Person.findTredjepartsPersoner(andrePersoner: List?): List {
return setOf(
- *this.fullmakt.map { it.motpartsPersonident }.toTypedArray(),
*this.vergemaalEllerFremtidsfullmakt.mapNotNull {
it.vergeEllerFullmektig.motpartsPersonident
}.toTypedArray(),
@@ -194,13 +202,16 @@ class PersondataServiceImpl(
*this.sivilstand.mapNotNull { it.relatertVedSivilstand }.toTypedArray(),
*this.forelderBarnRelasjon.mapNotNull { it.relatertPersonsIdent }.toTypedArray(),
*this.kontaktinformasjonForDoedsbo.mapNotNull { it.personSomKontakt?.identifikasjonsnummer }.toTypedArray(),
+ *(andrePersoner ?: emptyList()).toTypedArray(),
).toList()
}
- private fun Person.findKontaktinformasjonTredjepartspersoner(): List {
- return setOf(
- *this.fullmakt.map { it.motpartsPersonident }.toTypedArray(),
- ).toList()
+ private fun PersondataResult>.findKontaktinformasjonTredjepartspersoner(): List {
+ return this.fold(
+ onSuccess = { it.mapNotNull { it.fullmaktsgiver } },
+ onFailure = { system, cause -> emptyList() },
+ onNotRelevant = { emptyList() },
+ ).toSet().toList()
}
private fun hentTilganger(): PersondataService.Tilganger {
diff --git a/web/src/test/java/no/nav/modiapersonoversikt/rest/persondata/PersondataServiceImplTest.kt b/web/src/test/java/no/nav/modiapersonoversikt/rest/persondata/PersondataServiceImplTest.kt
index 94d1d3c64c..6d887764d2 100644
--- a/web/src/test/java/no/nav/modiapersonoversikt/rest/persondata/PersondataServiceImplTest.kt
+++ b/web/src/test/java/no/nav/modiapersonoversikt/rest/persondata/PersondataServiceImplTest.kt
@@ -23,6 +23,7 @@ internal class PersondataServiceImplTest {
oppfolgingService = mockk(),
policyEnforcementPoint = mockk(),
kodeverk = mockk(),
+ pdlFullmakt = mockk(),
)
@Test
diff --git a/web/src/test/java/no/nav/modiapersonoversikt/rest/persondata/PersondataTestdata.kt b/web/src/test/java/no/nav/modiapersonoversikt/rest/persondata/PersondataTestdata.kt
index 49e2c70773..f805b9c077 100644
--- a/web/src/test/java/no/nav/modiapersonoversikt/rest/persondata/PersondataTestdata.kt
+++ b/web/src/test/java/no/nav/modiapersonoversikt/rest/persondata/PersondataTestdata.kt
@@ -5,6 +5,8 @@ import no.nav.modiapersonoversikt.consumer.norg.NorgDomain
import no.nav.modiapersonoversikt.consumer.norg.NorgDomain.Publikumsmottak
import no.nav.modiapersonoversikt.consumer.pdl.generated.enums.*
import no.nav.modiapersonoversikt.consumer.pdl.generated.hentpersondata.*
+import no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.generated.models.FullmaktDetails
+import no.nav.modiapersonoversikt.consumer.pdlFullmaktApi.generated.models.OmraadeMedHandling
import no.nav.modiapersonoversikt.consumer.veilarboppfolging.ArbeidsrettetOppfolging
import no.nav.modiapersonoversikt.rest.persondata.PersondataResult.InformasjonElement
import no.nav.modiapersonoversikt.service.enhetligkodeverk.EnhetligKodeverk
@@ -323,10 +325,10 @@ internal val tilrettelagtKommunikasjonData =
)
internal val fullmaktPerson =
- Fullmakt(
- motpartsPersonident = "55555666000",
- motpartsRolle = FullmaktsRolle.FULLMEKTIG,
- omraader = emptyList(),
+ FullmaktDetails(
+ fullmaktId = 1232133123,
+ fullmaktsgiver = "55555666000",
+ omraade = listOf(OmraadeMedHandling(tema = "SAP", handling = listOf(OmraadeMedHandling.Handling.LES))),
gyldigFraOgMed = gittDato("2018-01-03"),
gyldigTilOgMed = gittDato("2018-10-03"),
)
@@ -486,7 +488,6 @@ internal val testPerson =
sikkerhetstiltak = listOf(sikkerhetstiltakData),
kontaktinformasjonForDoedsbo = listOf(kontaktinformasjonDodsbo),
tilrettelagtKommunikasjon = listOf(tilrettelagtKommunikasjonData),
- fullmakt = listOf(fullmaktPerson),
telefonnummer = listOf(Telefonnummer("47", "90909090", 1, metadata)),
vergemaalEllerFremtidsfullmakt = listOf(vergemal),
foreldreansvar = listOf(foreldreansvarData),
@@ -527,5 +528,6 @@ internal val testData =
PersondataResult.runCatching(InformasjonElement.DKIF_TREDJEPARTSPERSONER) {
kontaktinformasjonTredjepartspersonMap
},
+ fullmektige = PersondataResult.runCatching(InformasjonElement.FULLMAKT) { listOf(fullmaktPerson) },
harTilgangTilSkjermetPerson = false,
)
diff --git "a/web/src/test/resources/snapshots/no.nav.modiapersonoversikt.rest.persondata.PersondataFletterTest_skal mappe data fra pdl til Persondata n\303\245r person er dod-0.json" "b/web/src/test/resources/snapshots/no.nav.modiapersonoversikt.rest.persondata.PersondataFletterTest_skal mappe data fra pdl til Persondata n\303\245r person er dod-0.json"
index 8bde35d991..e8b92a71f7 100644
--- "a/web/src/test/resources/snapshots/no.nav.modiapersonoversikt.rest.persondata.PersondataFletterTest_skal mappe data fra pdl til Persondata n\303\245r person er dod-0.json"
+++ "b/web/src/test/resources/snapshots/no.nav.modiapersonoversikt.rest.persondata.PersondataFletterTest_skal mappe data fra pdl til Persondata n\303\245r person er dod-0.json"
@@ -203,7 +203,10 @@
},
"motpartsPersonident" : "55555666000",
"motpartsRolle" : "FULLMEKTIG",
- "omrade" : [ "java.util.ArrayList", [ ] ]
+ "omrade" : [ "java.util.ArrayList", [ {
+ "beskrivelse" : "SAP",
+ "kode" : "SAP"
+ } ] ]
} ] ],
"geografiskTilknytning" : null,
"kjonn" : [ "java.util.ArrayList", [ {
diff --git a/web/src/test/resources/snapshots/no.nav.modiapersonoversikt.rest.persondata.PersondataFletterTest_skal mappe data fra pdl til Persondata-0.json b/web/src/test/resources/snapshots/no.nav.modiapersonoversikt.rest.persondata.PersondataFletterTest_skal mappe data fra pdl til Persondata-0.json
index a96ca21ecf..64fdc9d3aa 100644
--- a/web/src/test/resources/snapshots/no.nav.modiapersonoversikt.rest.persondata.PersondataFletterTest_skal mappe data fra pdl til Persondata-0.json
+++ b/web/src/test/resources/snapshots/no.nav.modiapersonoversikt.rest.persondata.PersondataFletterTest_skal mappe data fra pdl til Persondata-0.json
@@ -203,7 +203,10 @@
},
"motpartsPersonident" : "55555666000",
"motpartsRolle" : "FULLMEKTIG",
- "omrade" : [ "java.util.ArrayList", [ ] ]
+ "omrade" : [ "java.util.ArrayList", [ {
+ "beskrivelse" : "SAP",
+ "kode" : "SAP"
+ } ] ]
} ] ],
"geografiskTilknytning" : "0123",
"kjonn" : [ "java.util.ArrayList", [ {