From 10743e66cfe2090c22c4f7cd5b2ab66bc19097d3 Mon Sep 17 00:00:00 2001 From: s148719 Date: Thu, 14 Dec 2023 13:54:47 +0100 Subject: [PATCH] Fjerne ubrukte db-repos --- .../database/repository/HusstandsbarnRepository.kt | 10 ---------- .../database/repository/SivilstandRepository.kt | 10 ---------- .../nav/bidrag/behandling/service/BehandlingService.kt | 8 -------- 3 files changed, 28 deletions(-) delete mode 100644 src/main/kotlin/no/nav/bidrag/behandling/database/repository/HusstandsbarnRepository.kt delete mode 100644 src/main/kotlin/no/nav/bidrag/behandling/database/repository/SivilstandRepository.kt diff --git a/src/main/kotlin/no/nav/bidrag/behandling/database/repository/HusstandsbarnRepository.kt b/src/main/kotlin/no/nav/bidrag/behandling/database/repository/HusstandsbarnRepository.kt deleted file mode 100644 index c76e6169e..000000000 --- a/src/main/kotlin/no/nav/bidrag/behandling/database/repository/HusstandsbarnRepository.kt +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.bidrag.behandling.database.repository - -import no.nav.bidrag.behandling.database.datamodell.Husstandsbarn -import org.springframework.data.repository.CrudRepository -import org.springframework.transaction.annotation.Transactional - -interface HusstandsbarnRepository : CrudRepository { - @Transactional - fun deleteByBehandlingId(behandlingsid: Long): Long -} diff --git a/src/main/kotlin/no/nav/bidrag/behandling/database/repository/SivilstandRepository.kt b/src/main/kotlin/no/nav/bidrag/behandling/database/repository/SivilstandRepository.kt deleted file mode 100644 index bc15cd679..000000000 --- a/src/main/kotlin/no/nav/bidrag/behandling/database/repository/SivilstandRepository.kt +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.bidrag.behandling.database.repository - -import no.nav.bidrag.behandling.database.datamodell.Sivilstand -import org.springframework.data.repository.CrudRepository -import org.springframework.transaction.annotation.Transactional - -interface SivilstandRepository : CrudRepository { - @Transactional - fun deleteByBehandlingId(behandlingsid: Long): Long -} diff --git a/src/main/kotlin/no/nav/bidrag/behandling/service/BehandlingService.kt b/src/main/kotlin/no/nav/bidrag/behandling/service/BehandlingService.kt index 8a349c599..c66e8c485 100644 --- a/src/main/kotlin/no/nav/bidrag/behandling/service/BehandlingService.kt +++ b/src/main/kotlin/no/nav/bidrag/behandling/service/BehandlingService.kt @@ -6,9 +6,7 @@ import no.nav.bidrag.behandling.consumer.BidragGrunnlagConsumer import no.nav.bidrag.behandling.database.datamodell.Behandling import no.nav.bidrag.behandling.database.datamodell.ForskuddAarsakType import no.nav.bidrag.behandling.database.repository.BehandlingRepository -import no.nav.bidrag.behandling.database.repository.HusstandsbarnRepository import no.nav.bidrag.behandling.database.repository.RolleRepository -import no.nav.bidrag.behandling.database.repository.SivilstandRepository import no.nav.bidrag.behandling.dto.behandling.CreateRolleDto import no.nav.bidrag.behandling.dto.behandling.SivilstandDto import no.nav.bidrag.behandling.dto.forsendelse.BehandlingInfoDto @@ -35,8 +33,6 @@ private val log = KotlinLogging.logger {} @Service class BehandlingService( private val behandlingRepository: BehandlingRepository, - private val husstandsbarnRepository: HusstandsbarnRepository, - private val sivilstandRepository: SivilstandRepository, private val bidragGrunnlagConsumer: BidragGrunnlagConsumer, private val rolleRepository: RolleRepository, private val forsendelseService: ForsendelseService, @@ -179,15 +175,11 @@ class BehandlingService( behandling.boforholdsbegrunnelseKunINotat = boforholdsbegrunnelseKunINotat behandling.boforholdsbegrunnelseIVedtakOgNotat = boforholdsbegrunnelseMedIVedtakOgNotat - // husstandsbarnRepository.deleteByBehandlingId(behandlingsid) behandling.husstandsbarn.clear() behandling.husstandsbarn.addAll(husstandsbarn.toDomain(behandling)) - // husstandsbarn.toDomain(behandling).forEach { husstandsbarnRepository.save(it) } - // sivilstandRepository.deleteByBehandlingId(behandlingsid) behandling.sivilstand.clear() behandling.sivilstand.addAll(sivilstand.toSivilstandDomain(behandling)) - // sivilstand.toSivilstandDomain(behandling).forEach { sivilstandRepository.save(it) } behandlingRepository.save(behandling) }