From 69a63065a2c836c209014e4ee0e7e3f9dd8229ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Golberg?= Date: Mon, 11 Nov 2024 16:37:10 +0100 Subject: [PATCH] =?UTF-8?q?Dropper=20=C3=A5=20avbryte=20hvis=20behandlings?= =?UTF-8?q?tatus=20ikke=20tillater=20det=20under=20omregning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/kotlin/behandling/BehandlingService.kt | 6 +++--- .../main/kotlin/behandling/omregning/OmregningService.kt | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/etterlatte-behandling/src/main/kotlin/behandling/BehandlingService.kt b/apps/etterlatte-behandling/src/main/kotlin/behandling/BehandlingService.kt index 1c175c6bd77..a0fccedbf00 100644 --- a/apps/etterlatte-behandling/src/main/kotlin/behandling/BehandlingService.kt +++ b/apps/etterlatte-behandling/src/main/kotlin/behandling/BehandlingService.kt @@ -258,7 +258,7 @@ interface BehandlingService { opphoerFraOgMed: YearMonth, ) - fun hentAapenOmregning(sakId: SakId): UUID? + fun hentAapenOmregning(sakId: SakId): Revurdering? fun oppdaterTidligereFamiliepleier( behandlingId: UUID, @@ -863,7 +863,7 @@ internal class BehandlingServiceImpl( } } - override fun hentAapenOmregning(sakId: SakId): UUID? = + override fun hentAapenOmregning(sakId: SakId): Revurdering? = behandlingDao .hentAlleRevurderingerISakMedAarsak( sakId, @@ -874,7 +874,7 @@ internal class BehandlingServiceImpl( ), ).singleOrNull { it.status != BehandlingStatus.AVBRUTT && it.status != BehandlingStatus.IVERKSATT - }?.id + } override fun oppdaterTidligereFamiliepleier( behandlingId: UUID, diff --git a/apps/etterlatte-behandling/src/main/kotlin/behandling/omregning/OmregningService.kt b/apps/etterlatte-behandling/src/main/kotlin/behandling/omregning/OmregningService.kt index 354e57acd19..4b5e0700ea1 100644 --- a/apps/etterlatte-behandling/src/main/kotlin/behandling/omregning/OmregningService.kt +++ b/apps/etterlatte-behandling/src/main/kotlin/behandling/omregning/OmregningService.kt @@ -26,7 +26,9 @@ class OmregningService( ) { if (request.status == KjoeringStatus.FEILA) { behandlingService.hentAapenOmregning(request.sakId)?.let { - behandlingService.avbrytBehandling(it, bruker) + if (it.status.kanAvbrytes()) { + behandlingService.avbrytBehandling(it.id, bruker) + } } } omregningDao.oppdaterKjoering(request)