From b1d2c9f2f9a02deec3597a21c57364bb6c9e6c13 Mon Sep 17 00:00:00 2001 From: Emil Elton Nilsen Date: Thu, 7 Nov 2024 08:50:19 +0100 Subject: [PATCH] =?UTF-8?q?=C3=85pne=20opp=20for=20=C3=A5=20la=20selvbetje?= =?UTF-8?q?ning=20sjekke=20om=20bruker=20har=20sak?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/etterlatte-api/.nais/dev-api.yaml | 6 ++++++ apps/etterlatte-api/.nais/prod-api.yaml | 6 ++++++ .../samordning/sak/BehandlingSakRoutes.kt | 20 +++++++++++++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/apps/etterlatte-api/.nais/dev-api.yaml b/apps/etterlatte-api/.nais/dev-api.yaml index 9132400a1a4..ee528128b8a 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-vedtak - 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..1484adf30db 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-vedtak - 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..fd928935ff1 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,21 @@ fun Route.behandlingSakRoutes( accessPolicyRolesEllerAdGrupper = generateRoles(config) issuers = setOf(Issuer.AZURE.issuerName) } + + get("/har_sak") { + val foedselsnummer = call.receive() + val saker = behandlingService.hentSakforPerson(foedselsnummer) + + if (saker.isNotEmpty()) { + call.respond(HarOMSSakIGjenny(true)) + } else { + call.respond(HarOMSSakIGjenny(false)) + } + } + post("/person/sak") { - val fnrOgSaktype = call.receive() - call.respond(behandlingService.hentSakforPerson(fnrOgSaktype)) + val foedselsnummer = call.receive() + call.respond(behandlingService.hentSakforPerson(foedselsnummer)) } } @@ -62,3 +74,7 @@ fun Route.behandlingSakRoutes( } } } + +data class HarOMSSakIGjenny( + val harOMSSak: Boolean, +)