-
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.
* Opprettelse av manuell behandling eller oppgaver styres med bryter * Lager tjenete i tidshendelser for årlig inntektsjustering * Egen status for manuell uten oppgave
- Loading branch information
Showing
10 changed files
with
121 additions
and
3 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
51 changes: 51 additions & 0 deletions
51
...no/nav/etterlatte/tidshendelser/aarliginntektsjustering/AarligInntektsjusteringService.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,51 @@ | ||
package no.nav.etterlatte.tidshendelser.aarliginntektsjustering | ||
|
||
import no.nav.etterlatte.libs.common.inntektsjustering.AarligInntektsjusteringRequest | ||
import no.nav.etterlatte.libs.common.rapidsandrivers.lagParMedEventNameKey | ||
import no.nav.etterlatte.rapidsandrivers.InntektsjusteringHendelseType | ||
import no.nav.etterlatte.rapidsandrivers.RapidEvents | ||
import no.nav.etterlatte.rapidsandrivers.ReguleringEvents | ||
import no.nav.etterlatte.rapidsandrivers.tilSeparertString | ||
import no.nav.etterlatte.tidshendelser.HendelserJobb | ||
import no.nav.etterlatte.tidshendelser.regulering.ReguleringDao | ||
import no.nav.etterlatte.tidshendelser.regulering.Reguleringskonfigurasjon | ||
import no.nav.helse.rapids_rivers.JsonMessage | ||
import org.slf4j.Logger | ||
import org.slf4j.LoggerFactory | ||
import java.util.UUID | ||
|
||
class AarligInntektsjusteringService( | ||
private val rapidsPublisher: (UUID, String) -> Unit, | ||
private val reguleringDao: ReguleringDao, | ||
) { | ||
val logger: Logger = LoggerFactory.getLogger(this::class.java) | ||
|
||
fun execute(jobb: HendelserJobb): List<Long> { | ||
logger.info("Handling jobb ${jobb.id}, type ${jobb.type} (${jobb.type.beskrivelse})") | ||
val konfigurasjon = reguleringDao.hentNyesteKonfigurasjon() | ||
startAarligInntektsjustering(konfigurasjon) | ||
return listOf() | ||
} | ||
|
||
private fun startAarligInntektsjustering(konfigurasjon: Reguleringskonfigurasjon) { | ||
logger.info("StartInntektsJob startet") | ||
rapidsPublisher( | ||
UUID.randomUUID(), | ||
createRecord(konfigurasjon), | ||
) | ||
logger.info("StartInntektsJob ferdig") | ||
} | ||
} | ||
|
||
fun createRecord(konfigurasjon: Reguleringskonfigurasjon) = | ||
JsonMessage | ||
.newMessage( | ||
mapOf( | ||
InntektsjusteringHendelseType.START_INNTEKTSJUSTERING_JOBB.lagParMedEventNameKey(), | ||
ReguleringEvents.DATO to AarligInntektsjusteringRequest.utledLoependeFom(), | ||
RapidEvents.KJOERING to AarligInntektsjusteringRequest.utledKjoering(), | ||
RapidEvents.ANTALL to konfigurasjon.antall, | ||
RapidEvents.SPESIFIKKE_SAKER to konfigurasjon.spesifikkeSaker.tilSeparertString(), | ||
RapidEvents.EKSKLUDERTE_SAKER to konfigurasjon.ekskluderteSaker.tilSeparertString(), | ||
), | ||
).toJson() |
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
9 changes: 8 additions & 1 deletion
9
.../kotlin/no/nav/etterlatte/libs/common/inntektsjustering/AarligInntektsjusteringRequest.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,10 +1,17 @@ | ||
package no.nav.etterlatte.libs.common.inntektsjustering | ||
|
||
import no.nav.etterlatte.libs.common.sak.SakId | ||
import java.time.Year | ||
import java.time.YearMonth | ||
|
||
data class AarligInntektsjusteringRequest( | ||
val kjoering: String, | ||
val loependeFom: YearMonth, | ||
val saker: List<SakId>, | ||
) | ||
) { | ||
companion object { | ||
fun utledKjoering() = "INNTEKTSJUSTERING_JOBB_${Year.now().value}" | ||
|
||
fun utledLoependeFom() = YearMonth.of(Year.now().value, 1) | ||
} | ||
} |
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 |
---|---|---|
|
@@ -34,4 +34,5 @@ enum class KjoeringStatus { | |
IKKE_LOEPENDE, | ||
FERDIGSTILT, | ||
TIL_MANUELL, | ||
TIL_MANUELL_UTEN_OPPGAVE, | ||
} |
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 |
---|---|---|
|
@@ -56,4 +56,5 @@ enum class JobbKategori { | |
ALDERSOVERGANG, | ||
OMS_DOEDSDATO, | ||
REGULERING, | ||
AARLIG_INNTEKTSJUSTERING, | ||
} |