Skip to content

Commit

Permalink
Skiller behov type for "ramme" og utbealingsvedtak
Browse files Browse the repository at this point in the history
  • Loading branch information
geiralund committed Aug 17, 2023
1 parent 8034180 commit e8ec9fc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ internal class PostgresIverksettingRepository(private val dataSource: DataSource

enum class IverksettingBehovDto {
Iverksett,
IverksettUtbetaling,
}

override fun map(behovNavn: String?): Aktivitet.Behov.Behovtype {
val behov = requireNotNull(behovNavn) { "Forventer at behov navn er satt" }
return when (IverksettingBehovDto.valueOf(behov)) {
IverksettingBehovDto.Iverksett -> IverksettingBehov.Iverksett
IverksettingBehovDto.IverksettUtbetaling -> IverksettingBehov.IverksettUtbetaling
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class Iverksetting private constructor(
object Mottatt : Tilstand(TilstandNavn.Mottatt) {
override fun håndter(utbetalingsvedtakFattetHendelse: UtbetalingsvedtakFattetHendelse, iverksetting: Iverksetting) {
utbetalingsvedtakFattetHendelse.behov(
type = IverksettingBehov.Iverksett,
type = IverksettingBehov.IverksettUtbetaling,
melding = "Sender behov for å iverksette utbetalingsvedtak",
detaljer = mapOf(
"vedtakId" to utbetalingsvedtakFattetHendelse.vedtakId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import no.nav.dagpenger.aktivitetslogg.Aktivitet

enum class IverksettingBehov : Aktivitet.Behov.Behovtype {
Iverksett,
IverksettUtbetaling,
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ internal class IverksettingTest {
)

assertBehov(
IverksettingBehov.Iverksett,
IverksettingBehov.IverksettUtbetaling,
forventetDetaljer = mapOf(
"ident" to ident,
"vedtakId" to vedtakId.toString(),
Expand Down

0 comments on commit e8ec9fc

Please sign in to comment.