This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
f Jobb som henter 5 tilfeldige fnr som stikkprøver og prøver å popule…
…re arbeidssøkerperioder for dem
- Loading branch information
Showing
4 changed files
with
55 additions
and
0 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
33 changes: 33 additions & 0 deletions
33
...no/nav/fo/veilarbregistrering/arbeidssoker/perioder/PopulerHistoriskePerioderScheduler.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,33 @@ | ||
package no.nav.fo.veilarbregistrering.arbeidssoker.perioder | ||
|
||
import no.nav.fo.veilarbregistrering.aktorIdCache.AktorIdCacheRepository | ||
import no.nav.fo.veilarbregistrering.bruker.Bruker | ||
import no.nav.fo.veilarbregistrering.bruker.PdlOppslagGateway | ||
import no.nav.fo.veilarbregistrering.log.secureLogger | ||
import org.springframework.scheduling.annotation.Scheduled | ||
|
||
class PopulerHistoriskePerioderScheduler( | ||
private val populerArbeidssokerperioderService: PopulerArbeidssokerperioderService, | ||
private val pdlOppslagGateway: PdlOppslagGateway, | ||
private val aktorIdCacheRepository: AktorIdCacheRepository | ||
) { | ||
|
||
@Scheduled(initialDelay = 180000, fixedDelay = Long.MAX_VALUE) | ||
fun populerHistoriskePerioder() { | ||
val tilfeldigeFnr = aktorIdCacheRepository.hentTilfeldigFnr(5) | ||
|
||
tilfeldigeFnr.forEach { | ||
val identer = pdlOppslagGateway.hentIdenter(it.aktorId) | ||
|
||
val arbeidssoker = populerArbeidssokerperioderService.hentArbeidssøker( | ||
Bruker( | ||
identer.finnGjeldendeFnr(), | ||
it.aktorId, | ||
identer.finnHistoriskeFoedselsnummer() | ||
) | ||
) | ||
|
||
secureLogger.info("Fant følgende perioder for fnr ${identer.finnGjeldendeFnr()}: ${arbeidssoker.allePerioder()}") | ||
} | ||
} | ||
} |
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