-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IS-2114: Send arbeidsuforhet forhandsvarsel to docdist
- Loading branch information
1 parent
57f66d9
commit 94aed2c
Showing
7 changed files
with
88 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/kotlin/no/nav/syfo/service/ArbeidsuforhetForhandsvarselService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package no.nav.syfo.service | ||
|
||
import no.nav.syfo.consumer.distribuerjournalpost.DistibusjonsType | ||
import no.nav.syfo.kafka.consumers.varselbus.domain.ArbeidstakerHendelse | ||
import no.nav.syfo.utils.dataToVarselData | ||
import org.slf4j.LoggerFactory | ||
|
||
class ArbeidsuforhetForhandsvarselService(private val senderFacade: SenderFacade) { | ||
|
||
suspend fun sendVarselTilArbeidstaker(varselHendelse: ArbeidstakerHendelse) { | ||
log.info("[ARBEIDSUFORHET_FORHANDSVARSEL] sending enabled") | ||
val data = dataToVarselData(varselHendelse.data) | ||
requireNotNull(data.journalpost) | ||
requireNotNull(data.journalpost.id) | ||
|
||
log.info("Sending [ARBEIDSUFORHET_FORHANDSVARSEL] to print") | ||
senderFacade.sendBrevTilFysiskPrint( | ||
uuid = data.journalpost.uuid, | ||
varselHendelse = varselHendelse, | ||
journalpostId = data.journalpost.id, | ||
distribusjonsType = DistibusjonsType.VIKTIG, | ||
) | ||
} | ||
|
||
companion object { | ||
private val log = LoggerFactory.getLogger(ArbeidsuforhetForhandsvarselService::class.qualifiedName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters