Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
r Fjern ubrukt kode - jobb for å populere aktørId-cache er nå ferdig
Browse files Browse the repository at this point in the history
  • Loading branch information
Martine Enger committed Feb 6, 2023
1 parent a152f9f commit 6fdbc37
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 127 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
package no.nav.fo.veilarbregistrering.aktorIdCache

import no.nav.common.featuretoggle.UnleashClient
import no.nav.common.job.leader_election.LeaderElectionClient
import no.nav.fo.veilarbregistrering.arbeidssoker.formidlingsgruppe.FormidlingsgruppeRepository
import no.nav.fo.veilarbregistrering.bruker.PdlOppslagGateway
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class AktorIdCacheConfig {
@Bean
fun populerAktorIdWorker(
pdlOppslagGateway: PdlOppslagGateway,
formidlingsgruppeRepository: FormidlingsgruppeRepository,
aktorIdCacheRepository: AktorIdCacheRepository,
unleashClient: UnleashClient,
leaderElectionClient: LeaderElectionClient
): PopulerAktorIdWorker {
return PopulerAktorIdWorker(
formidlingsgruppeRepository,
pdlOppslagGateway,
aktorIdCacheRepository,
unleashClient,
leaderElectionClient
)

}
@Bean
fun aktorIdCacheService(
pdlOppslagGateway: PdlOppslagGateway,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ import no.nav.fo.veilarbregistrering.bruker.Foedselsnummer
interface AktorIdCacheRepository {

fun lagre(aktorIdCache: AktorIdCache)
fun lagreBolk(aktorIdCacheListe: List<AktorIdCache>): Int
fun hentAktørId(fnr: Foedselsnummer): AktorIdCache?
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ class AktorIdCacheRepositoryImpl(private val db: NamedParameterJdbcTemplate): Ak
}
}

override fun lagreBolk(aktorIdCacheListe: List<AktorIdCache>): Int {
val params = aktorIdCacheListe.map {
mapOf(
"foedselsnummer" to it.foedselsnummer.foedselsnummer,
"aktor_id" to it.aktorId.aktorId,
"opprettet_dato" to it.opprettetDato
)
}

val sql = "INSERT INTO aktor_id_cache (foedselsnummer, aktor_id, opprettet_dato) values (:foedselsnummer, :aktor_id, :opprettet_dato)" +
" on conflict do nothing"

return db.batchUpdate(sql, params.toTypedArray()).sum()
}

override fun hentAktørId(fnr: Foedselsnummer): AktorIdCache? {
val sql = "SELECT * FROM aktor_id_cache WHERE foedselsnummer = :fnr"
val params = mapOf("fnr" to fnr.foedselsnummer)
Expand Down

0 comments on commit 6fdbc37

Please sign in to comment.