Skip to content

Commit

Permalink
Dropper å avbryte hvis behandlingstatus ikke tillater det under omreg…
Browse files Browse the repository at this point in the history
…ning
  • Loading branch information
Bjodn committed Nov 11, 2024
1 parent b7c2c58 commit 69a6306
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ interface BehandlingService {
opphoerFraOgMed: YearMonth,
)

fun hentAapenOmregning(sakId: SakId): UUID?
fun hentAapenOmregning(sakId: SakId): Revurdering?

fun oppdaterTidligereFamiliepleier(
behandlingId: UUID,
Expand Down Expand Up @@ -863,7 +863,7 @@ internal class BehandlingServiceImpl(
}
}

override fun hentAapenOmregning(sakId: SakId): UUID? =
override fun hentAapenOmregning(sakId: SakId): Revurdering? =
behandlingDao
.hentAlleRevurderingerISakMedAarsak(
sakId,
Expand All @@ -874,7 +874,7 @@ internal class BehandlingServiceImpl(
),
).singleOrNull {
it.status != BehandlingStatus.AVBRUTT && it.status != BehandlingStatus.IVERKSATT
}?.id
}

override fun oppdaterTidligereFamiliepleier(
behandlingId: UUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 69a6306

Please sign in to comment.