-
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.
IS-2711: Historikk for veilederknytning
- Loading branch information
1 parent
52152ed
commit 173e994
Showing
11 changed files
with
170 additions
and
97 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
27 changes: 17 additions & 10 deletions
27
src/main/kotlin/no/nav/syfo/personstatus/PersonTildelingService.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,18 +1,25 @@ | ||
package no.nav.syfo.personstatus | ||
|
||
import no.nav.syfo.personstatus.infrastructure.database.DatabaseInterface | ||
import no.nav.syfo.personstatus.db.lagreVeilederForBruker | ||
import no.nav.syfo.personstatus.application.IPersonOversiktStatusRepository | ||
import no.nav.syfo.personstatus.domain.PersonIdent | ||
import no.nav.syfo.personstatus.domain.VeilederBrukerKnytning | ||
import no.nav.syfo.personstatus.infrastructure.cronjob.behandlendeenhet.PersonBehandlendeEnhetService | ||
|
||
class PersonTildelingService(private val database: DatabaseInterface) { | ||
|
||
fun lagreKnytningMellomVeilederOgBruker( | ||
class PersonTildelingService( | ||
private val personoversiktStatusRepository: IPersonOversiktStatusRepository, | ||
private val personBehandlendeEnhetService: PersonBehandlendeEnhetService, | ||
) { | ||
suspend fun lagreKnytningMellomVeilederOgBruker( | ||
veilederBrukerKnytninger: List<VeilederBrukerKnytning>, | ||
tildeltAv: String, | ||
) = veilederBrukerKnytninger.map { | ||
database.lagreVeilederForBruker( | ||
veilederBrukerKnytning = it, | ||
tildeltAv = tildeltAv, | ||
) | ||
) { | ||
veilederBrukerKnytninger.map { | ||
personoversiktStatusRepository.createPersonOversiktStatusIfMissing(PersonIdent(it.fnr)) | ||
personBehandlendeEnhetService.updateBehandlendeEnhet(PersonIdent(it.fnr)) | ||
personoversiktStatusRepository.lagreVeilederForBruker( | ||
veilederBrukerKnytning = it, | ||
tildeltAv = tildeltAv, | ||
) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.