Skip to content

Commit

Permalink
Merge pull request #1195 from navikt/svarbrev-fullmektig
Browse files Browse the repository at this point in the history
Send svarbrev to fullmektig if exists.
  • Loading branch information
flexable777 authored Aug 27, 2024
2 parents f0472b9 + e44cf09 commit 781877b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,19 @@ class MottakService(
val svarbrevSettings = svarbrevSettingsService.getSvarbrevSettingsForYtelseAndType(ytelse = behandling.ytelse, type = behandling.type)

if (svarbrevSettings.shouldSend) {
val receiverId = if (behandling.klager.prosessfullmektig != null) {
behandling.klager.prosessfullmektig!!.partId.value
} else {
behandling.sakenGjelder.partId.value
}

dokumentUnderArbeidService.createAndFinalizeDokumentUnderArbeidFromSvarbrev(
behandling = behandling,
svarbrev = Svarbrev(
title = "NAV orienterer om saksbehandlingen",
receivers = listOf(
Svarbrev.Receiver(
id = behandling.sakenGjelder.partId.value,
id = receiverId,
handling = Svarbrev.Receiver.HandlingEnum.AUTO,
overriddenAddress = null
)
Expand Down

0 comments on commit 781877b

Please sign in to comment.