Skip to content

Commit

Permalink
⚰️ Takk for nå, TransactionalSaksbehandlerDao. Det ble et kort liv.
Browse files Browse the repository at this point in the history
  • Loading branch information
chsko committed Oct 28, 2024
1 parent 4de7daf commit 346b249
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package no.nav.helse.db

import kotliquery.sessionOf
import no.nav.helse.HelseDao
import kotliquery.Session
import no.nav.helse.HelseDao.Companion.asSQL
import java.time.LocalDateTime
import java.util.UUID
import javax.sql.DataSource

class SaksbehandlerDao(private val dataSource: DataSource) : HelseDao(dataSource), SaksbehandlerRepository {
class SaksbehandlerDao(private val queryRunner: QueryRunner) : SaksbehandlerRepository, QueryRunner by queryRunner {
constructor(session: Session) : this(MedSession(session))
constructor(dataSource: DataSource) : this(MedDataSource(dataSource))

fun opprettEllerOppdater(
oid: UUID,
navn: String,
Expand Down Expand Up @@ -41,7 +44,13 @@ class SaksbehandlerDao(private val dataSource: DataSource) : HelseDao(dataSource
).update()

override fun finnSaksbehandler(oid: UUID) =
sessionOf(dataSource).use { session ->
TransactionalSaksbehandlerDao(session).finnSaksbehandler(oid)
}
asSQL("SELECT * FROM saksbehandler WHERE oid = :oid LIMIT 1", "oid" to oid)
.single { row ->
SaksbehandlerFraDatabase(
epostadresse = row.string("epost"),
oid = row.uuid("oid"),
navn = row.string("navn"),
ident = row.string("ident"),
)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import no.nav.helse.db.OpptegnelseRepository
import no.nav.helse.db.PgTotrinnsvurderingDao
import no.nav.helse.db.ReservasjonDao
import no.nav.helse.db.ReservasjonRepository
import no.nav.helse.db.SaksbehandlerDao
import no.nav.helse.db.SaksbehandlerRepository
import no.nav.helse.db.SorteringsnøkkelForDatabase
import no.nav.helse.db.TildelingDao
import no.nav.helse.db.TildelingRepository
import no.nav.helse.db.TotrinnsvurderingDao
import no.nav.helse.db.TotrinnsvurderingFraDatabase
import no.nav.helse.db.TransactionalOppgaveDao
import no.nav.helse.db.TransactionalSaksbehandlerDao
import no.nav.helse.mediator.SaksbehandlerMediator.Companion.tilApiversjon
import no.nav.helse.mediator.TilgangskontrollørForApi
import no.nav.helse.mediator.oppgave.OppgaveMapper.tilApiversjon
Expand Down Expand Up @@ -80,7 +80,7 @@ internal class OppgaveService(
reservasjonRepository = ReservasjonDao(transactionalSession),
opptegnelseRepository = OpptegnelseDao(transactionalSession),
totrinnsvurderingDao = PgTotrinnsvurderingDao(transactionalSession),
saksbehandlerRepository = TransactionalSaksbehandlerDao(transactionalSession),
saksbehandlerRepository = SaksbehandlerDao(transactionalSession),
rapidsConnection = rapidsConnection,
tilgangskontroll = tilgangskontroll,
tilgangsgrupper = tilgangsgrupper,
Expand Down

0 comments on commit 346b249

Please sign in to comment.