From 149ae9242f8571ad9dc66b736aa6232e4d186980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20N=2E=20Wed=C3=B8e?= Date: Tue, 3 Dec 2024 15:05:45 +0100 Subject: [PATCH 1/4] Updated kodeverk. --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2e764cee0..599f25ab6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ val jacksonJsonschemaVersion = "1.0.39" val pdfboxVersion = "3.0.3" val tikaVersion = "3.0.0" val verapdfVersion = "1.26.1" -val klageKodeverkVersion = "1.8.60" +val klageKodeverkVersion = "1.8.61" val commonsFileupload2JakartaVersion = "2.0.0-M1" val otelVersion = "1.44.1" From 977814bbca51eb417e72ed392f12ee574c2e9c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20N=2E=20Wed=C3=B8e?= Date: Tue, 10 Dec 2024 12:32:02 +0100 Subject: [PATCH 2/4] Use correct date in mottattKlageinstans in Kafka message. --- .../no/nav/klage/oppgave/service/CreateBehandlingFromMottak.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/no/nav/klage/oppgave/service/CreateBehandlingFromMottak.kt b/src/main/kotlin/no/nav/klage/oppgave/service/CreateBehandlingFromMottak.kt index 5642845ba..fc37c870a 100644 --- a/src/main/kotlin/no/nav/klage/oppgave/service/CreateBehandlingFromMottak.kt +++ b/src/main/kotlin/no/nav/klage/oppgave/service/CreateBehandlingFromMottak.kt @@ -62,7 +62,7 @@ class CreateBehandlingFromMottak( detaljer = BehandlingDetaljer( ankebehandlingOpprettet = AnkebehandlingOpprettetDetaljer( - mottattKlageinstans = ankebehandling.created + mottattKlageinstans = ankebehandling.mottattKlageinstans ) ) ) From cd0a183e5df05effe25adc59789cfe80dd704b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20N=2E=20Wed=C3=B8e?= Date: Tue, 10 Dec 2024 13:24:11 +0100 Subject: [PATCH 3/4] Retryable annotation for kabalinnstillinger. --- .../nav/klage/oppgave/service/KabalInnstillingerService.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/no/nav/klage/oppgave/service/KabalInnstillingerService.kt b/src/main/kotlin/no/nav/klage/oppgave/service/KabalInnstillingerService.kt index 0dbe9ca29..67da46707 100644 --- a/src/main/kotlin/no/nav/klage/oppgave/service/KabalInnstillingerService.kt +++ b/src/main/kotlin/no/nav/klage/oppgave/service/KabalInnstillingerService.kt @@ -4,12 +4,14 @@ import no.nav.klage.kodeverk.Ytelse import no.nav.klage.oppgave.clients.kabalinnstillinger.KabalInnstillingerClient import no.nav.klage.oppgave.clients.kabalinnstillinger.model.* import no.nav.klage.oppgave.domain.klage.Behandling +import org.springframework.retry.annotation.Retryable import org.springframework.stereotype.Service @Service class KabalInnstillingerService( private val kabalInnstillingerClient: KabalInnstillingerClient, ) { + @Retryable fun getPotentialSaksbehandlere(behandling: Behandling): Saksbehandlere { return kabalInnstillingerClient.searchSaksbehandlere( SaksbehandlerSearchInput( @@ -19,6 +21,7 @@ class KabalInnstillingerService( ) } + @Retryable fun getPotentialMedunderskrivere(behandling: Behandling): Medunderskrivere { if (behandling.tildeling == null) { return Medunderskrivere(medunderskrivere = emptyList()) @@ -33,6 +36,7 @@ class KabalInnstillingerService( ) } + @Retryable fun getPotentialROL(behandling: Behandling): Saksbehandlere { return kabalInnstillingerClient.searchROL( ROLSearchInput( @@ -42,12 +46,14 @@ class KabalInnstillingerService( } //TODO: Bør vi ha et cache her? Kan være et problem om leder gir nye tilganger, kanskje et kortere cache? + @Retryable fun getTildelteYtelserForSaksbehandler(navIdent: String): List { return kabalInnstillingerClient.getSaksbehandlersTildelteYtelser(navIdent).ytelseIdList.map { Ytelse.of(it) } } + @Retryable fun getTildelteYtelserForEnhet(enhet: String): Set { return kabalInnstillingerClient.getTildelteYtelserForEnhet(enhet).ytelseIdList.map { Ytelse.of(it) From 724ca237f414eace3e7c39e0fc8f709cc7eb83d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20N=2E=20Wed=C3=B8e?= Date: Tue, 10 Dec 2024 13:40:03 +0100 Subject: [PATCH 4/4] Create merkantil task when unable to assign behandling after creation. --- .../oppgave/service/ExternalMottakFacade.kt | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/no/nav/klage/oppgave/service/ExternalMottakFacade.kt b/src/main/kotlin/no/nav/klage/oppgave/service/ExternalMottakFacade.kt index 549f0f498..47d22399b 100644 --- a/src/main/kotlin/no/nav/klage/oppgave/service/ExternalMottakFacade.kt +++ b/src/main/kotlin/no/nav/klage/oppgave/service/ExternalMottakFacade.kt @@ -33,7 +33,7 @@ class ExternalMottakFacade( val behandling = mottakService.createMottakForKlageAnkeV3(oversendtKlageAnke) if (oversendtKlageAnke.saksbehandlerIdent != null) { - setSaksbehandler(behandling = behandling, saksbehandlerIdent = oversendtKlageAnke.saksbehandlerIdent) + tryToSetSaksbehandler(behandling = behandling, saksbehandlerIdent = oversendtKlageAnke.saksbehandlerIdent) } tryToSendSvarbrev(behandling, hindreAutomatiskSvarbrev = oversendtKlageAnke.hindreAutomatiskSvarbrev == true) @@ -49,7 +49,7 @@ class ExternalMottakFacade( val behandling = mottakService.createMottakForKlageAnkeV3(oversendtKlageAnke) if (oversendtKlageAnke.saksbehandlerIdent != null) { - setSaksbehandler(behandling = behandling, saksbehandlerIdent = oversendtKlageAnke.saksbehandlerIdent) + tryToSetSaksbehandler(behandling = behandling, saksbehandlerIdent = oversendtKlageAnke.saksbehandlerIdent) } tryToSendSvarbrev(behandling, hindreAutomatiskSvarbrev = oversendtKlageAnke.hindreAutomatiskSvarbrev == true) @@ -74,6 +74,23 @@ class ExternalMottakFacade( } } + private fun tryToSetSaksbehandler( + behandling: Behandling, + saksbehandlerIdent: String + ) { + try { + setSaksbehandler( + behandling = behandling, + saksbehandlerIdent = saksbehandlerIdent, + ) + } catch (e: Exception) { + mottakService.createTaskForMerkantil( + behandlingId = behandling.id, + reason = "Klarte ikke å tildele behandling ${behandling.id} til saksbehandlerIdent $saksbehandlerIdent. Feilmelding: ${e.message}" + ) + } + } + private fun setSaksbehandler(behandling: Behandling, saksbehandlerIdent: String) { logger.debug("Preparing to set saksbehandler. Getting enhet for saksbehandler $saksbehandlerIdent") val enhetForSaksbehandler = try {