Skip to content

Commit

Permalink
Merge pull request #207 from navikt/feature/eksternreferanseid
Browse files Browse the repository at this point in the history
Use callId as eksternReferanseId when creating journalpost
  • Loading branch information
enstulen authored Nov 29, 2023
2 parents fae6e93 + b190cae commit ef9e090
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ class JournalpostConsumer(
histogram = true
)
fun opprettJournalpost(opprettJournalpostRequestTo: OpprettJournalpostRequestTo): OpprettJournalpostResponseTo {
log.info("Oppretter journalpost")
val callId = MDC.get(MDC_CALL_ID)
log.info("Oppretter journalpost for callId {}", callId)

val journalpostReponse = webClient
.method(HttpMethod.POST)
.uri("$journalpostUrl/journalpost/$FORSOEK_FERDIGSTILL")
.contentType(APPLICATION_JSON)
.accept(APPLICATION_JSON)
.body(BodyInserters.fromValue(opprettJournalpostRequestTo))
.header("Nav-Callid", MDC.get(MDC_CALL_ID))
.header("Nav-Callid", callId)
.header("Nav-Consumer-Id", "srvtilbakemeldings")
.retrieve()
.bodyToMono(OpprettJournalpostResponseTo::class.java)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package no.nav.tilbakemeldingsmottak.rest.serviceklage.service.support

import no.nav.tilbakemeldingsmottak.config.MDCConstants.MDC_CALL_ID
import no.nav.tilbakemeldingsmottak.consumer.joark.domain.*
import no.nav.tilbakemeldingsmottak.model.OpprettServiceklageRequest
import no.nav.tilbakemeldingsmottak.model.OpprettServiceklageRequest.PaaVegneAv.*
import org.slf4j.MDC
import org.springframework.stereotype.Component

@Component
Expand Down Expand Up @@ -38,7 +40,8 @@ class OpprettJournalpostRequestToMapper {
tema = TEMA_SER,
tittel = TITTEL_SERVICEKLAGE,
kanal = if (innlogget) KANAL_NAV_NO else KANAL_NAV_NO_UINNLOGGET,
dokumenter = listOf(buildDokument(fysiskDokument))
dokumenter = listOf(buildDokument(fysiskDokument)),
eksternReferanseId = MDC.get(MDC_CALL_ID)
)
}

Expand Down

0 comments on commit ef9e090

Please sign in to comment.