-
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.
La saksbehandler krympe vedtaksperioden, men krev en begrunnelse
Begrunnelsen ender opp i vedtaksbrevet for å informere bruker om hvorfor vedtaksperioden er kortere enn perioden de søkte på. Dette kan for eksempel komme av at bruker har begynt på arbeidstiltak senere enn perioden det er søkt for. Begrunnelsen er en standardtekst og per nå er det bare lagt opp til at bare endring i tiltaksdeltagelse er årsak til endring av vedtaksperiode. Dette vil endre seg etterhvert som de andre vilkårene blir periodisert.
- Loading branch information
Showing
20 changed files
with
640 additions
and
8 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
17 changes: 17 additions & 0 deletions
17
app/src/main/kotlin/no/nav/tiltakspenger/vedtak/repository/behandling/SubsumsjonDb.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,17 @@ | ||
package no.nav.tiltakspenger.vedtak.repository.behandling | ||
|
||
import no.nav.tiltakspenger.saksbehandling.domene.behandling.TilleggstekstBrev | ||
|
||
enum class SubsumsjonDb { | ||
TILTAKSDELTAGELSE, | ||
} | ||
|
||
fun SubsumsjonDb.toDomain(): TilleggstekstBrev.Subsumsjon = | ||
when (this) { | ||
SubsumsjonDb.TILTAKSDELTAGELSE -> TilleggstekstBrev.Subsumsjon.TILTAKSDELTAGELSE | ||
} | ||
|
||
fun TilleggstekstBrev.Subsumsjon.toDb(): SubsumsjonDb = | ||
when (this) { | ||
TilleggstekstBrev.Subsumsjon.TILTAKSDELTAGELSE -> SubsumsjonDb.TILTAKSDELTAGELSE | ||
} |
31 changes: 31 additions & 0 deletions
31
.../main/kotlin/no/nav/tiltakspenger/vedtak/repository/behandling/TilleggstekstBrevDbJson.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,31 @@ | ||
package no.nav.tiltakspenger.vedtak.repository.behandling | ||
|
||
import no.nav.tiltakspenger.libs.json.deserialize | ||
import no.nav.tiltakspenger.libs.json.serialize | ||
import no.nav.tiltakspenger.saksbehandling.domene.behandling.TilleggstekstBrev | ||
import java.security.InvalidParameterException | ||
|
||
data class TilleggstekstBrevDbJson( | ||
val subsumsjon: SubsumsjonDb, | ||
val tekst: String, | ||
) | ||
|
||
internal fun String.toTilleggstekstBrev(): TilleggstekstBrev = | ||
try { | ||
val tilleggstekstBrevJson = deserialize<TilleggstekstBrevDbJson>(this) | ||
|
||
TilleggstekstBrev( | ||
subsumsjon = tilleggstekstBrevJson.subsumsjon.toDomain(), | ||
tekst = tilleggstekstBrevJson.tekst, | ||
) | ||
} catch (exception: Exception) { | ||
throw InvalidParameterException("Det oppstod en feil ved parsing av json: " + exception.message) | ||
} | ||
|
||
internal fun TilleggstekstBrev.toDbJson(): String = | ||
serialize( | ||
TilleggstekstBrevDbJson( | ||
subsumsjon = subsumsjon.toDb(), | ||
tekst = tekst, | ||
), | ||
) |
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
13 changes: 13 additions & 0 deletions
13
app/src/main/kotlin/no/nav/tiltakspenger/vedtak/routes/behandling/Subsumsjon.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.tiltakspenger.vedtak.routes.behandling | ||
|
||
import no.nav.tiltakspenger.saksbehandling.domene.behandling.TilleggstekstBrev | ||
|
||
enum class SubsumsjonDTO { | ||
TILTAKSDELTAGELSE, | ||
} | ||
|
||
internal fun TilleggstekstBrev.Subsumsjon.toDTO(): SubsumsjonDTO { | ||
return when (this) { | ||
TilleggstekstBrev.Subsumsjon.TILTAKSDELTAGELSE -> SubsumsjonDTO.TILTAKSDELTAGELSE | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/kotlin/no/nav/tiltakspenger/vedtak/routes/behandling/TilleggstekstBrevDTO.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,14 @@ | ||
package no.nav.tiltakspenger.vedtak.routes.behandling | ||
|
||
import no.nav.tiltakspenger.saksbehandling.domene.behandling.TilleggstekstBrev | ||
|
||
data class TilleggstekstBrevDTO( | ||
val subsumsjon: SubsumsjonDTO, | ||
val tekst: String, | ||
) | ||
|
||
fun TilleggstekstBrev.toDTO(): TilleggstekstBrevDTO = | ||
TilleggstekstBrevDTO( | ||
subsumsjon = subsumsjon.toDTO(), | ||
tekst = tekst, | ||
) |
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
1 change: 1 addition & 0 deletions
1
app/src/main/resources/db/migration/V23__legg_til_tilleggstekst_brev.sql
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 @@ | ||
ALTER TABLE behandling ADD COLUMN IF NOT EXISTS tilleggstekst_brev varchar; |
Oops, something went wrong.