From 85277e6f208310ca7ceb7288faf835f2aeb1ea8b Mon Sep 17 00:00:00 2001 From: Emil Elton Nilsen <45180092+perkynades@users.noreply.github.com> Date: Thu, 7 Nov 2024 12:24:21 +0100 Subject: [PATCH] =?UTF-8?q?EY-4663=20-=20=C3=85pne=20opp=20for=20=C3=A5=20?= =?UTF-8?q?la=20selvbetjening=20sjekke=20om=20bruker=20har=20sak=20(#6241)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Åpne opp for å la selvbetjening sjekke om bruker har sak * Oppdater rolle til å være mer spesifik for bruken * Forenkle logikk i route --- apps/etterlatte-api/.nais/dev-api.yaml | 6 ++++++ apps/etterlatte-api/.nais/prod-api.yaml | 6 ++++++ .../samordning/sak/BehandlingSakRoutes.kt | 16 ++++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/apps/etterlatte-api/.nais/dev-api.yaml b/apps/etterlatte-api/.nais/dev-api.yaml index 9132400a1a4..d8341098608 100644 --- a/apps/etterlatte-api/.nais/dev-api.yaml +++ b/apps/etterlatte-api/.nais/dev-api.yaml @@ -104,6 +104,12 @@ spec: accessPolicy: inbound: rules: + - application: selvbetjening-backend + namespace: etterlatte + cluster: dev-gcp + permissions: + roles: + - les-oms-sak-for-person - application: arbeid-og-inntekt namespace: team-inntekt cluster: dev-fss diff --git a/apps/etterlatte-api/.nais/prod-api.yaml b/apps/etterlatte-api/.nais/prod-api.yaml index 47924d4a3fd..c542462ef8c 100644 --- a/apps/etterlatte-api/.nais/prod-api.yaml +++ b/apps/etterlatte-api/.nais/prod-api.yaml @@ -102,6 +102,12 @@ spec: accessPolicy: inbound: rules: + - application: selvbetjening-backend + namespace: etterlatte + cluster: prod-gcp + permissions: + roles: + - les-oms-sak-for-person - application: arbeid-og-inntekt namespace: team-inntekt cluster: prod-fss diff --git a/apps/etterlatte-api/src/main/kotlin/no/nav/etterlatte/samordning/sak/BehandlingSakRoutes.kt b/apps/etterlatte-api/src/main/kotlin/no/nav/etterlatte/samordning/sak/BehandlingSakRoutes.kt index 9a26fe48f11..255fed7ed38 100644 --- a/apps/etterlatte-api/src/main/kotlin/no/nav/etterlatte/samordning/sak/BehandlingSakRoutes.kt +++ b/apps/etterlatte-api/src/main/kotlin/no/nav/etterlatte/samordning/sak/BehandlingSakRoutes.kt @@ -39,9 +39,17 @@ fun Route.behandlingSakRoutes( accessPolicyRolesEllerAdGrupper = generateRoles(config) issuers = setOf(Issuer.AZURE.issuerName) } + + get("/har_sak") { + val foedselsnummer = call.receive() + val saker = behandlingService.hentSakforPerson(foedselsnummer) + + call.respond(HarOMSSakIGjenny(saker.isNotEmpty())) + } + post("/person/sak") { - val fnrOgSaktype = call.receive() - call.respond(behandlingService.hentSakforPerson(fnrOgSaktype)) + val foedselsnummer = call.receive() + call.respond(behandlingService.hentSakforPerson(foedselsnummer)) } } @@ -62,3 +70,7 @@ fun Route.behandlingSakRoutes( } } } + +data class HarOMSSakIGjenny( + val harOMSSak: Boolean, +)