Skip to content

Commit

Permalink
Merge pull request #1219 from navikt/use_behandling_in_event
Browse files Browse the repository at this point in the history
Use behandling in event
  • Loading branch information
oyvind-wedoe authored Sep 19, 2024
2 parents 9bf1df0 + e448318 commit a92fb6c
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ class UpdateOppgaveApiEventListener(
@Transactional(propagation = Propagation.REQUIRES_NEW)
fun updateOppgave(behandlingEndretEvent: BehandlingEndretEvent) {
logger.debug("updateOppgave called. Received BehandlingEndretEvent for behandlingId {}", behandlingEndretEvent.behandling.id)
val behandling = behandlingRepository.findById(behandlingEndretEvent.behandling.id).get()

if (behandling.oppgaveId != null && behandlingEndretEvent.endringslogginnslag.any { it.felt == Felt.TILDELT_SAKSBEHANDLERIDENT }) {
if (behandlingEndretEvent.endringslogginnslag.any { it.felt == Felt.TILDELT_SAKSBEHANDLERIDENT } && behandlingEndretEvent.behandling.oppgaveId != null) {
oppgaveApiService.assignOppgave(
oppgaveId = behandling.oppgaveId!!,
tildeltSaksbehandlerIdent = behandling.tildeling?.saksbehandlerident,
oppgaveId = behandlingEndretEvent.behandling.oppgaveId!!,
tildeltSaksbehandlerIdent = behandlingEndretEvent.behandling.tildeling?.saksbehandlerident,
systemContext = behandlingEndretEvent.endringslogginnslag.any { it.saksbehandlerident == systembrukerIdent }
)
}
Expand Down

0 comments on commit a92fb6c

Please sign in to comment.