-
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.
Feature/informasjon om saksbehandlingstid ut (#1221)
* Lagt ny brevkode UT_INFORMASJON_OM_SAKSBEHANDLINGSTID til Pesysbrevkoder.kt * Bumped apiModelVersion til 118 * Opprettet data class InformasjonOmSaksbehandlingstidUtDto i InformasjonOmSaksbehandlingstidUT.kt * Opprettet brevmal InformasjonOmSaksbehandlingstidUT.kt * Opprettet brevmal InformasjonOmSaksbehandlingstidUT.kt * Opprettet brevmal InformasjonOmSaksbehandlingstidUT.kt * Oppdaterte InformasjonOmSaksbehandlingstidUT.kt * Oppdaterte InformasjonOmSaksbehandlingstidUT.kt med tekster for forlenget saksbehandlingstid * Oppdaterte InformasjonOmSaksbehandlingstidUtTest.kt * Lagt InformasjonOmSaksbehandlingstidUT til ProductionTemplates.kt * Lagt InformasjonOmSaksbehandlingstidUT til ProductionTemplates.kt * Oppdaterte InformasjonOmSaksbehandlingstidUtDto * Testet ok - uten og med forlengetSaksbehandlingstid * Oppdaterte tekst i InformasjonOmSaksbehandlingstidUT.kt * Oppdaterte InformasjonOmForlengetSaksbehandlingstidUT.kt * Oppdaterte apiModelVersion til 119 * Oppdaterte displayTitle i InformasjonOmSaksbehandlingstidUT.kt
- Loading branch information
Showing
10 changed files
with
201 additions
and
4 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
15 changes: 15 additions & 0 deletions
15
...otlin/no/nav/pensjon/brev/api/model/maler/redigerbar/InformasjonOmSaksbehandlingstidUT.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,15 @@ | ||
package no.nav.pensjon.brev.api.model.maler.redigerbar | ||
|
||
import no.nav.pensjon.brev.api.model.maler.BrevbakerBrevdata | ||
import no.nav.pensjon.brev.api.model.maler.EmptyBrevdata | ||
import no.nav.pensjon.brev.api.model.maler.RedigerbarBrevdata | ||
|
||
@Suppress("unused") | ||
data class InformasjonOmSaksbehandlingstidUtDto( | ||
override val saksbehandlerValg: SaksbehandlerValg, | ||
override val pesysData: EmptyBrevdata | ||
) : RedigerbarBrevdata<InformasjonOmSaksbehandlingstidUtDto.SaksbehandlerValg, EmptyBrevdata> { | ||
data class SaksbehandlerValg( | ||
val forlengetSaksbehandlingstid: Boolean = false, | ||
) : BrevbakerBrevdata | ||
} |
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
121 changes: 121 additions & 0 deletions
121
...src/main/kotlin/no/nav/pensjon/brev/maler/redigerbar/InformasjonOmSaksbehandlingstidUT.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,121 @@ | ||
package no.nav.pensjon.brev.maler.redigerbar | ||
|
||
import no.nav.pensjon.brev.api.model.Sakstype | ||
import no.nav.pensjon.brev.api.model.TemplateDescription | ||
import no.nav.pensjon.brev.api.model.maler.Pesysbrevkoder | ||
import no.nav.pensjon.brev.api.model.maler.redigerbar.InformasjonOmSaksbehandlingstidUtDto | ||
import no.nav.pensjon.brev.api.model.maler.redigerbar.InformasjonOmSaksbehandlingstidUtDtoSelectors.SaksbehandlerValgSelectors.forlengetSaksbehandlingstid | ||
import no.nav.pensjon.brev.api.model.maler.redigerbar.InformasjonOmSaksbehandlingstidUtDtoSelectors.saksbehandlerValg | ||
import no.nav.pensjon.brev.maler.fraser.common.Felles | ||
import no.nav.pensjon.brev.template.Language.* | ||
import no.nav.pensjon.brev.template.RedigerbarTemplate | ||
import no.nav.pensjon.brev.template.dsl.createTemplate | ||
import no.nav.pensjon.brev.template.dsl.expression.expr | ||
import no.nav.pensjon.brev.template.dsl.expression.plus | ||
import no.nav.pensjon.brev.template.dsl.helpers.TemplateModelHelpers | ||
import no.nav.pensjon.brev.template.dsl.languages | ||
import no.nav.pensjon.brev.template.dsl.text | ||
import no.nav.pensjon.brev.template.dsl.textExpr | ||
import no.nav.pensjon.brevbaker.api.model.LetterMetadata | ||
|
||
@TemplateModelHelpers | ||
object InformasjonOmSaksbehandlingstidUT : RedigerbarTemplate<InformasjonOmSaksbehandlingstidUtDto> { | ||
|
||
// MF 000130 (AP_INFO_STID_MAN) | ||
override val kode = Pesysbrevkoder.Redigerbar.UT_INFORMASJON_OM_SAKSBEHANDLINGSTID | ||
override val kategori = TemplateDescription.Brevkategori.INFORMASJONSBREV | ||
override val brevkontekst = TemplateDescription.Brevkontekst.SAK | ||
override val sakstyper = setOf(Sakstype.UFOREP) | ||
|
||
override val template = createTemplate( | ||
name = kode.name, | ||
letterDataType = InformasjonOmSaksbehandlingstidUtDto::class, | ||
languages = languages(Bokmal, Nynorsk, English), | ||
letterMetadata = LetterMetadata( | ||
displayTitle = "Informasjon om saksbehandlingstid Uføretrygd", | ||
isSensitiv = false, | ||
distribusjonstype = LetterMetadata.Distribusjonstype.VIKTIG, | ||
brevtype = LetterMetadata.Brevtype.INFORMASJONSBREV, | ||
) | ||
) { | ||
title { | ||
showIf(saksbehandlerValg.forlengetSaksbehandlingstid) { | ||
text( | ||
Bokmal to "Informasjon om forlenget saksbehandlingstid", | ||
Nynorsk to "Informasjon om forlenget saksbehandlingstid", | ||
English to "Information about application processing delay", | ||
) | ||
}.orShow { | ||
text( | ||
Bokmal to "Informasjon om saksbehandlingstiden vår", | ||
Nynorsk to "Informasjon om saksbehandlingstida vår", | ||
English to "Information about our application processing time", | ||
) | ||
} | ||
} | ||
outline { | ||
paragraph { | ||
val mottattDato = fritekst("dato") | ||
|
||
showIf(saksbehandlerValg.forlengetSaksbehandlingstid) { | ||
val aarsak = fritekst("årsak til forsinkelse") | ||
textExpr( | ||
Bokmal to "Vi har ".expr() + mottattDato + " mottatt din søknad om uføretrygd. " | ||
+ "Det vil dessverre ta oss lengre tid enn antatt å behandle kravet. " | ||
+ "Forsinkelsen skyldes ".expr() + aarsak + ".", | ||
Nynorsk to "Vi har ".expr() + mottattDato + " fått søknaden din om uføretrygd. " | ||
+ "Det vil dessverre ta oss lengre tid enn venta å behandle kravet. " | ||
+ "Forsinkinga skuldast ".expr() + aarsak + ".", | ||
English to "We have received your application for disabilty benefit on the ".expr() + mottattDato + ". " | ||
+ "Due to delays in ".expr() + aarsak + ", " | ||
+ "the processing of your case will take longer than we anticipated." | ||
) | ||
}.orShow { | ||
textExpr( | ||
Bokmal to "Vi har ".expr() + mottattDato + " mottatt søknaden din om uføretrygd fra folketrygden.", | ||
Nynorsk to "Vi har ".expr() + mottattDato + " fått søknaden din om uføretrygd frå folketrygda.", | ||
English to "We have received your application for disability benefit from the Norwegian National Insurance Scheme on ".expr() + mottattDato + ".", | ||
) | ||
} | ||
} | ||
showIf(saksbehandlerValg.forlengetSaksbehandlingstid) { | ||
title1 { | ||
text( | ||
Bokmal to "Ny svartid", | ||
Nynorsk to "Ny svartid", | ||
English to "New estimated date for completion", | ||
) | ||
} | ||
paragraph { | ||
val svartid = fritekst("svartid") | ||
textExpr( | ||
Bokmal to "Vi antar at kravet ditt kan bli ferdigbehandlet innen ".expr() + svartid + ".", | ||
Nynorsk to "Vi reknar med at kravet ditt kan bli ferdigbehandla innan ".expr() + svartid + ".", | ||
English to "Without further delays, we assume the processing of your case to be completed within ".expr() + svartid + "." | ||
) | ||
} | ||
}.orShow { | ||
paragraph { | ||
val svartid = fritekst("svartid") | ||
textExpr( | ||
Bokmal to "Saksbehandlingstiden vår er vanligvis ".expr() + svartid + ".", | ||
Nynorsk to "Saksbehandlingstida vår er vanlegvis ".expr() + svartid + ".", | ||
English to "Our processing time is usually ".expr() + svartid + ".", | ||
) | ||
} | ||
} | ||
paragraph { | ||
text( | ||
Bokmal to "Dersom vi trenger flere opplysninger fra deg, vil du høre fra oss.", | ||
Nynorsk to "Dersom vi treng fleire opplysningar frå deg, vil du høyre frå oss.", | ||
English to "We will contact you if we need you to provide more information." | ||
) | ||
} | ||
includePhrase(Felles.MeldeFraEndringer) | ||
includePhrase(Felles.HarDuSpoersmaal.ufoeretrygd) | ||
} | ||
} | ||
} | ||
|
||
|
||
|
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
13 changes: 13 additions & 0 deletions
13
...aker/src/test/kotlin/no/nav/pensjon/brev/fixtures/InformasjonOmSaksbehandlingstidUtDto.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,13 @@ | ||
package no.nav.pensjon.brev.fixtures | ||
|
||
import no.nav.pensjon.brev.api.model.maler.EmptyBrevdata | ||
import no.nav.pensjon.brev.api.model.maler.redigerbar.InformasjonOmSaksbehandlingstidUtDto.SaksbehandlerValg | ||
import no.nav.pensjon.brev.api.model.maler.redigerbar.InformasjonOmSaksbehandlingstidUtDto | ||
|
||
fun createInformasjonOmSaksbehandlingstidUtDto() = | ||
InformasjonOmSaksbehandlingstidUtDto( | ||
saksbehandlerValg = SaksbehandlerValg( | ||
forlengetSaksbehandlingstid = false, | ||
), | ||
pesysData = EmptyBrevdata | ||
) |
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
45 changes: 45 additions & 0 deletions
45
...test/kotlin/no/nav/pensjon/brev/maler/redigerbar/InformasjonOmSaksbehandlingstidUtTest.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,45 @@ | ||
package no.nav.pensjon.brev.maler.redigerbar | ||
|
||
import no.nav.pensjon.brev.Fixtures | ||
import no.nav.pensjon.brev.TestTags | ||
import no.nav.pensjon.brev.api.model.maler.EmptyBrevdata | ||
import no.nav.pensjon.brev.api.model.maler.redigerbar.InformasjonOmSaksbehandlingstidUtDto | ||
import no.nav.pensjon.brev.api.toLanguage | ||
import no.nav.pensjon.brev.renderTestPDF | ||
import no.nav.pensjon.brev.template.Letter | ||
import no.nav.pensjon.brevbaker.api.model.LanguageCode.* | ||
import org.junit.jupiter.api.Tag | ||
import org.junit.jupiter.api.Test | ||
|
||
@Tag(TestTags.MANUAL_TEST) | ||
class InformasjonOmSaksbehandlingstidUtTest { | ||
|
||
private val data = InformasjonOmSaksbehandlingstidUtDto( | ||
saksbehandlerValg = InformasjonOmSaksbehandlingstidUtDto.SaksbehandlerValg( | ||
forlengetSaksbehandlingstid = false | ||
), | ||
pesysData = EmptyBrevdata | ||
) | ||
|
||
@Test | ||
fun `uten forlengetSaksbehandlingstid`() { | ||
writeAllLanguages("uten-forlenget-saksbehandlingstid", data) | ||
} | ||
|
||
@Test | ||
fun `med forlengetSaksbehandlingstid`() { | ||
writeAllLanguages("med-forlengset-saksbehandlingstid", data.copy(saksbehandlerValg = data.saksbehandlerValg.copy(forlengetSaksbehandlingstid = true))) | ||
} | ||
|
||
private fun writeAllLanguages(testNavn: String, data: InformasjonOmSaksbehandlingstidUtDto) { | ||
listOf(BOKMAL, NYNORSK, ENGLISH).forEach { lang -> | ||
Letter( | ||
InformasjonOmSaksbehandlingstidUT.template, | ||
data, | ||
lang.toLanguage(), | ||
Fixtures.felles | ||
).renderTestPDF("000130-$testNavn-${lang.name}") | ||
} | ||
} | ||
|
||
} |