Skip to content

Commit

Permalink
Logg mer info dersom vi finner mer enn én oppgave for fagsystem id
Browse files Browse the repository at this point in the history
  • Loading branch information
sillerud committed Feb 5, 2025
1 parent bc0bd4a commit e3c5c76
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,15 @@ class OppgaveService(
behandling: Behandling,
): Oppgave? {
val (_, finnOppgaveResponse) = finnOppgave(behandling, oppgavetype, fagsakRepository.findByIdOrThrow(behandling.fagsakId))
return finnOppgaveResponse.oppgaver.singleOrNull { it.status != StatusEnum.FERDIGSTILT }
val ferdigstilteOppgaver = finnOppgaveResponse.oppgaver.filter { it.status != StatusEnum.FERDIGSTILT }
if (ferdigstilteOppgaver.size > 1) {
secureLogger.warn(
"Fant flere enn en oppgave for behandling med fagsakId={}, oppgaveinfo: ({})",
behandling.fagsakId,
ferdigstilteOppgaver.map { "opprettet: ${it.opprettetTidspunkt}, type: ${it.oppgavetype}" },
)
}
return ferdigstilteOppgaver.singleOrNull()
}

private fun finnAktuellMappe(
Expand Down

0 comments on commit e3c5c76

Please sign in to comment.