-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Innført datastruktur for data fra godkjenningsbehovet
Et steg på veien til å frikoble dataene kommandokjeder trenger fra meldingene fra rapiden. Co-authored-by: Christian Bülow Skovborg <[email protected]> Co-authored-by: Øydis Kind Refsum <[email protected]>
- Loading branch information
1 parent
732f5ce
commit 3a32c38
Showing
9 changed files
with
147 additions
and
144 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
24 changes: 11 additions & 13 deletions
24
...lve/src/main/kotlin/no/nav/helse/modell/kommando/ForberedBehandlingAvGodkjenningsbehov.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 |
---|---|---|
@@ -1,23 +1,21 @@ | ||
package no.nav.helse.modell.kommando | ||
|
||
import no.nav.helse.modell.person.Person | ||
import no.nav.helse.modell.vedtaksperiode.SpleisVedtaksperiode | ||
import java.time.LocalDate | ||
import java.util.UUID | ||
import no.nav.helse.modell.vedtaksperiode.GodkjenningsbehovData | ||
|
||
internal class ForberedBehandlingAvGodkjenningsbehov( | ||
private val commandData: GodkjenningsbehovData, | ||
private val person: Person, | ||
private val spleisVedtaksperioder: List<SpleisVedtaksperiode>, | ||
private val vedtaksperiodeId: UUID, | ||
private val utbetalingId: UUID, | ||
private val spleisBehandlingId: UUID, | ||
private val tags: List<String>, | ||
private val skjæringstidspunkt: LocalDate, | ||
): Command { | ||
) : Command { | ||
override fun execute(context: CommandContext): Boolean { | ||
person.mottaSpleisVedtaksperioder(spleisVedtaksperioder) | ||
person.flyttEventuelleAvviksvarsler(vedtaksperiodeId, skjæringstidspunkt) | ||
person.oppdaterPeriodeTilGodkjenning(vedtaksperiodeId, tags, spleisBehandlingId, utbetalingId) | ||
person.mottaSpleisVedtaksperioder(commandData.spleisVedtaksperioder) | ||
person.flyttEventuelleAvviksvarsler(commandData.vedtaksperiodeId, commandData.skjæringstidspunkt) | ||
person.oppdaterPeriodeTilGodkjenning( | ||
commandData.vedtaksperiodeId, | ||
commandData.tags, | ||
commandData.spleisBehandlingId, | ||
commandData.utbetalingId, | ||
) | ||
return true | ||
} | ||
} |
13 changes: 6 additions & 7 deletions
13
...st-selve/src/main/kotlin/no/nav/helse/modell/kommando/OpprettKoblingTilAvviksvurdering.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
13 changes: 8 additions & 5 deletions
13
...st-selve/src/main/kotlin/no/nav/helse/modell/kommando/OpprettKoblingTilHendelseCommand.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 |
---|---|---|
@@ -1,19 +1,22 @@ | ||
package no.nav.helse.modell.kommando | ||
|
||
import no.nav.helse.modell.VedtakDao | ||
import java.util.* | ||
import no.nav.helse.modell.vedtaksperiode.GodkjenningsbehovData | ||
|
||
internal class OpprettKoblingTilHendelseCommand( | ||
private val hendelseId: UUID, | ||
private val vedtaksperiodeId: UUID, | ||
commandData: GodkjenningsbehovData, | ||
private val vedtakDao: VedtakDao, | ||
) : Command { | ||
private val meldingId = commandData.id | ||
|
||
private val vedtaksperiodeId = commandData.vedtaksperiodeId | ||
|
||
override fun execute(context: CommandContext): Boolean { | ||
vedtakDao.opprettKobling(vedtaksperiodeId, hendelseId) | ||
vedtakDao.opprettKobling(vedtaksperiodeId, meldingId) | ||
return true | ||
} | ||
|
||
override fun undo(context: CommandContext) { | ||
vedtakDao.fjernKobling(vedtaksperiodeId, hendelseId) | ||
vedtakDao.fjernKobling(vedtaksperiodeId, meldingId) | ||
} | ||
} |
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.