Skip to content

Commit

Permalink
Merge pull request #62 from navikt/reuse-person-ident-mapping
Browse files Browse the repository at this point in the history
Reuse personident mapping
  • Loading branch information
tu55eladd authored Sep 12, 2023
2 parents 136c663 + 29b5d60 commit edda861
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ open class DeltakerProcessor(

// Translation opprettes ikke før denne er kjørt.
val aktivitetId = arenaIdTranslationService.hentEllerOpprettAktivitetId(deltaker.tiltakdeltakerId, AktivitetKategori.TILTAKSAKTIVITET)
val personIdent = ordsClient.hentFnr(deltaker.personId)
val personIdent = personsporingService.get(deltaker.personId, arenaGjennomforingId)?.fodselsnummer ?: ordsClient.hentFnr(deltaker.personId)
?: throw IllegalStateException("Expected person with personId=${deltaker.personId} to exist")
personsporingService.upsert(PersonSporingDbo(personIdent = deltaker.personId, fodselsnummer = personIdent, tiltakgjennomforingId = arenaGjennomforingId))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ class PersonsporingService (
val personSporingRepository: PersonSporingRepository
) {
fun upsert(personSporingDbo: PersonSporingDbo) = personSporingRepository.upsert(personSporingDbo)
fun get(personId: Long, gjennomforingId: Long) = personSporingRepository.get(personId, gjennomforingId)
}

0 comments on commit edda861

Please sign in to comment.