Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Flytter loggmelding på oppdatert søknad
Browse files Browse the repository at this point in the history
  • Loading branch information
ekun committed Jun 27, 2024
1 parent 1bb15ad commit 07cb26a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package no.nav.aap.api.søknad.arkiv

import java.time.LocalDateTime.parse
import org.springframework.kafka.annotation.KafkaListener
import org.springframework.messaging.handler.annotation.Payload
import org.springframework.transaction.annotation.Transactional
import no.nav.aap.api.søknad.arkiv.ArkivConfig.Companion.ARKIVHENDELSER
import no.nav.aap.api.søknad.fordeling.SøknadRepository
import no.nav.aap.util.LoggerUtil.getLogger
import no.nav.aap.util.TimeExtensions.toUTC
import no.nav.boot.conditionals.ConditionalOnGCP
import no.nav.joarkjournalfoeringhendelser.JournalfoeringHendelseRecord
import org.springframework.kafka.annotation.KafkaListener
import org.springframework.messaging.handler.annotation.Payload
import org.springframework.transaction.annotation.Transactional
import java.time.LocalDateTime.parse

@ConditionalOnGCP
class ArkivHendelseKonsument(private val repo: SøknadRepository) {
Expand All @@ -35,8 +35,8 @@ class ArkivHendelseKonsument(private val repo: SøknadRepository) {

private fun oppdaterSøknad(payload: JournalfoeringHendelseRecord) =
with(payload) {
log.info("Oppdaterer søknad med id $journalpostId med status $journalpostStatus ")
repo.getSøknadByJournalpostid("$journalpostId")?.let {søknad ->
log.info("Oppdaterer søknad med id $journalpostId med status $journalpostStatus ")
søknad.apply {
journalpoststatus = journalpostStatus
journalfoert = tilUTC()
Expand Down

0 comments on commit 07cb26a

Please sign in to comment.