-
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.
Legg til ny brevmal UTBETALING_ETTER_KA_VEDTAK
- Loading branch information
1 parent
b8e7118
commit f48ce67
Showing
6 changed files
with
120 additions
and
2 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
33 changes: 33 additions & 0 deletions
33
src/main/kotlin/no/nav/familie/ks/sak/kjerne/brev/domene/maler/UtbetalingEtterKAVedtak.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,33 @@ | ||
package no.nav.familie.ks.sak.kjerne.brev.domene.maler | ||
|
||
import no.nav.familie.ks.sak.common.util.tilDagMånedÅr | ||
import java.time.LocalDate | ||
|
||
data class UtbetalingEtterKAVedtakBrevDto( | ||
override val mal: Brevmal = Brevmal.UTBETALING_ETTER_KA_VEDTAK, | ||
override val data: UtbetalingEtterKAVedtakDataDto, | ||
) : BrevDto | ||
|
||
data class UtbetalingEtterKAVedtakDataDto( | ||
override val delmalData: DelmalData, | ||
override val flettefelter: FlettefelterDto, | ||
) : BrevDataDto { | ||
data class FlettefelterDto( | ||
override val navn: Flettefelt, | ||
override val fodselsnummer: Flettefelt, | ||
override val brevOpprettetDato: Flettefelt = flettefelt(LocalDate.now().tilDagMånedÅr()), | ||
) : FlettefelterForDokumentDto { | ||
constructor( | ||
navn: String, | ||
fodselsnummer: String, | ||
) : this( | ||
navn = flettefelt(navn), | ||
fodselsnummer = flettefelt(fodselsnummer), | ||
) | ||
} | ||
|
||
data class DelmalData( | ||
val signatur: SignaturDelmal, | ||
val fritekstAvsnitt: FritekstAvsnitt?, | ||
) | ||
} |
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
43 changes: 43 additions & 0 deletions
43
src/test/enhetstester/kotlin/no/nav/familie/ks/sak/api/dto/ManueltBrevDtoTest.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,43 @@ | ||
package no.nav.familie.ks.sak.api.dto | ||
|
||
import no.nav.familie.kontrakter.felles.arbeidsfordeling.Enhet | ||
import no.nav.familie.ks.sak.data.randomFnr | ||
import no.nav.familie.ks.sak.kjerne.brev.domene.maler.Brevmal | ||
import no.nav.familie.ks.sak.kjerne.brev.domene.maler.UtbetalingEtterKAVedtakDataDto | ||
import org.assertj.core.api.Assertions.assertThat | ||
import org.junit.jupiter.api.Nested | ||
import org.junit.jupiter.api.Test | ||
|
||
class ManueltBrevDtoTest { | ||
@Nested | ||
inner class TilBrev { | ||
@Test | ||
fun `skal generere UTBETALING_ETTER_KA_VEDTAK-brev`() { | ||
val manueltBrevDto = | ||
lagManueltBrevDto( | ||
brevmal = Brevmal.UTBETALING_ETTER_KA_VEDTAK, | ||
fritekstAvsnitt = "Fritekst avsnitt", | ||
) | ||
|
||
val brevDto = manueltBrevDto.tilBrev(saksbehandlerNavn = "Saks Behandlersen") | ||
|
||
assertThat(brevDto.mal).isEqualTo(Brevmal.UTBETALING_ETTER_KA_VEDTAK) | ||
|
||
val delmalData = brevDto.data.delmalData as UtbetalingEtterKAVedtakDataDto.DelmalData | ||
assertThat(delmalData.signatur.saksbehandler).containsExactly("Saks Behandlersen") | ||
assertThat(delmalData.fritekstAvsnitt?.fritekstAvsnittTekst).containsExactly("Fritekst avsnitt") | ||
} | ||
} | ||
|
||
private fun lagManueltBrevDto( | ||
brevmal: Brevmal, | ||
mottakerIdent: String = randomFnr(), | ||
fritekstAvsnitt: String? = null, | ||
enhet: Enhet = Enhet("1234", "Enhet"), | ||
) = ManueltBrevDto( | ||
brevmal = brevmal, | ||
mottakerIdent = mottakerIdent, | ||
fritekstAvsnitt = fritekstAvsnitt, | ||
enhet = enhet, | ||
) | ||
} |