-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate handling of errors from start
- Loading branch information
1 parent
a51fc53
commit 41e2261
Showing
10 changed files
with
178 additions
and
63 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
39 changes: 39 additions & 0 deletions
39
...ening/omsorgsopptjening/bestem/pensjonsopptjening/persongrunnlag/model/Feilinformasjon.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,39 @@ | ||
package no.nav.pensjon.opptjening.omsorgsopptjening.bestem.pensjonsopptjening.persongrunnlag.model | ||
|
||
import no.nav.pensjon.opptjening.omsorgsopptjening.felles.domene.kafka.messages.domene.Feilinformasjon | ||
import no.nav.pensjon.opptjening.omsorgsopptjening.felles.domene.kafka.messages.domene.IdentRolle | ||
|
||
fun List<Feilinformasjon>.oppgavetekster(omsorgsyter: String): Set<String> { | ||
return map { | ||
when (it) { | ||
is Feilinformasjon.OverlappendeBarnetrygdperioder -> { | ||
"Kunne ikke behandle godskriving av omsorgsopptjening automatisk for $omsorgsyter på grunn av motstridende opplysninger for barnetrygdperiodene tilhørende et av barna. Vurder omsorgsopptjening manuelt." | ||
} | ||
|
||
is Feilinformasjon.OverlappendeHjelpestønadperioder -> { | ||
"Kunne ikke behandle godskriving av omsorgsopptjening automatisk for $omsorgsyter på grunn av motstridende opplysninger for hjelpestønadsperiodene tilhørende et av barna. Vurder omsorgsopptjening manuelt." | ||
} | ||
|
||
is Feilinformasjon.UgyldigIdent -> { | ||
"""Kunne ikke behandle godskriving av omsorgsopptjening automatisk for $omsorgsyter på grunn av at det ikke eksisterer et gjeldende fnr for ${ | ||
rolle( | ||
it | ||
) | ||
} med ident: ${it.ident}""".trimIndent() | ||
} | ||
|
||
is Feilinformasjon.FeilIDataGrunnlag -> { | ||
"Kunne ikke behandle godskriving av omsorgsopptjening automatisk for $omsorgsyter på grunn av feil i datagrunnlaget. Vurder omsorgsopptjening manuelt." | ||
} | ||
} | ||
}.toSet() | ||
} | ||
|
||
private fun rolle(it: Feilinformasjon.UgyldigIdent) = | ||
when (it.identRolle) { | ||
IdentRolle.BARNETRYGDMOTTAKER -> "barnetrygdmottaker" | ||
IdentRolle.OMSORGSYTER_BARNETRYGD -> "barnetrygdmottaker" | ||
IdentRolle.OMSORGSYTER_HJELPESTONAD -> "barnetrygdmottaker" | ||
IdentRolle.OMSORGSMOTTAKER_BARNETRYGD -> "barn" | ||
IdentRolle.OMSORGSMOTTAKER_HJELPESTONAD -> "barn" | ||
} |
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
Oops, something went wrong.