-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sett behandling tilbake til vent og opprett manuell oppgave hvis snik…
… i køen feiler (#4537) ### 💰 Hva skal gjøres, og hvorfor? [Favro](https://favro.com/organization/98c34fb974ce445eac854de0/1844bbac3b6605eacc8f5543?card=NAV-20549) Dersom en behandling er på vent og vi prøver å snike i køen og snikingen feiler settes ikke behandlingen tilbake til påVent. Vi får da feil når den forsøkes å tas av vent. Setter nå behandlingen tilbake til påVent og henlegger den automatiske behandlingen som prøver å snike i køen og lager en oppgave for manuell behandling på behandlingen som var til vent i stedet.
- Loading branch information
Showing
10 changed files
with
228 additions
and
22 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
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
42 changes: 42 additions & 0 deletions
42
.../ba/sak/task/dto/HenleggAutovedtakOgSettBehandlingTilbakeTilVentVedSmåbarnstilleggTask.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,42 @@ | ||
package no.nav.familie.ba.sak.task.dto | ||
|
||
import no.nav.familie.ba.sak.kjerne.autovedtak.småbarnstillegg.AutovedtakSmåbarnstilleggService | ||
import no.nav.familie.ba.sak.kjerne.behandling.BehandlingHentOgPersisterService | ||
import no.nav.familie.kontrakter.felles.objectMapper | ||
import no.nav.familie.prosessering.AsyncTaskStep | ||
import no.nav.familie.prosessering.TaskStepBeskrivelse | ||
import no.nav.familie.prosessering.domene.Task | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
@TaskStepBeskrivelse( | ||
taskStepType = HenleggAutovedtakOgSettBehandlingTilbakeTilVentVedSmåbarnstilleggTask.TASK_STEP_TYPE, | ||
beskrivelse = "Henlegg autovedtak og sett behandling tilbake til vent", | ||
maxAntallFeil = 1, | ||
) | ||
class HenleggAutovedtakOgSettBehandlingTilbakeTilVentVedSmåbarnstilleggTask( | ||
private val autovedtakSmåbarnstilleggService: AutovedtakSmåbarnstilleggService, | ||
private val behandlingHentOgPersisterService: BehandlingHentOgPersisterService, | ||
) : AsyncTaskStep { | ||
override fun doTask(task: Task) { | ||
val meldingIOppgave = "Småbarnstillegg: endring i overgangsstønad må behandles manuelt" | ||
val behandlingId = objectMapper.readValue(task.payload, Long::class.java) | ||
val behandling = behandlingHentOgPersisterService.hent(behandlingId) | ||
val metric = | ||
autovedtakSmåbarnstilleggService | ||
.antallVedtakOmOvergangsstønadTilManuellBehandling[AutovedtakSmåbarnstilleggService.TilManuellBehandlingÅrsak.NYE_UTBETALINGSPERIODER_FØRER_TIL_MANUELL_BEHANDLING]!! | ||
|
||
autovedtakSmåbarnstilleggService.kanIkkeBehandleAutomatisk(behandling, metric, meldingIOppgave) | ||
} | ||
|
||
companion object { | ||
const val TASK_STEP_TYPE = "henleggAutovedtakOgSettBehandlingTilbakeTilVentTask" | ||
|
||
fun opprettTask(behandlingId: Long) = | ||
Task( | ||
type = TASK_STEP_TYPE, | ||
payload = objectMapper.writeValueAsString(behandlingId), | ||
properties = mapOf("behandlingId" to behandlingId.toString()).toProperties(), | ||
) | ||
} | ||
} |
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.