Skip to content

Commit

Permalink
fjerner avhengighet til egen database
Browse files Browse the repository at this point in the history
sporbar henter dokumenter fra spedisjon

Co-authored-by: Simen Ullern <[email protected]>
Co-authored-by: Håkon Arneng Holmstedt <[email protected]>
  • Loading branch information
3 people committed Nov 25, 2024
1 parent 8679ecd commit e099787
Show file tree
Hide file tree
Showing 26 changed files with 2 additions and 578 deletions.
10 changes: 0 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ val tbdLibsVersion = "2024.11.25-10.59-6f263a10"
val ktorVersion = "3.0.1"
val junitJupiterVersion = "5.11.3"
val mockkVersion = "1.13.13"
val postgresqlVersion = "42.7.4"
val kotliqueryVersion = "1.9.0"
val hikariCPVersion = "6.1.0"
val flywayVersion = "10.21.0"
val jsonSchemaValidatorVersion = "1.0.73"
val jsonassertVersion = "1.5.1"

Expand All @@ -32,13 +28,7 @@ dependencies {
exclude(group = "junit")
}

implementation("com.zaxxer:HikariCP:$hikariCPVersion")
implementation("org.postgresql:postgresql:$postgresqlVersion")
implementation("org.flywaydb:flyway-database-postgresql:$flywayVersion")
implementation("com.github.seratch:kotliquery:$kotliqueryVersion")

testImplementation("com.github.navikt.tbd-libs:rapids-and-rivers-test:$tbdLibsVersion")
testImplementation("com.github.navikt.tbd-libs:postgres-testdatabaser:$tbdLibsVersion")
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("com.networknt:json-schema-validator:$jsonSchemaValidatorVersion")
testImplementation("org.skyscreamer:jsonassert:$jsonassertVersion")
Expand Down
10 changes: 0 additions & 10 deletions deploy/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ spec:
pool: nav-dev
secureLogs:
enabled: true
gcp:
sqlInstances:
- type: POSTGRES_16
diskAutoresize: true
pointInTimeRecovery: true
tier: db-f1-micro
name: sporbar
databases:
- name: sporbar
envVarPrefix: DATABASE
accessPolicy:
outbound:
rules:
Expand Down
10 changes: 0 additions & 10 deletions deploy/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ spec:
pool: nav-prod
secureLogs:
enabled: true
gcp:
sqlInstances:
- type: POSTGRES_15
diskAutoresize: true
pointInTimeRecovery: true
tier: db-custom-4-16384
name: sporbar
databases:
- name: sporbar
envVarPrefix: DATABASE
accessPolicy:
outbound:
rules:
Expand Down
18 changes: 2 additions & 16 deletions src/main/kotlin/no/nav/helse/sporbar/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.github.navikt.tbd_libs.azure.createAzureTokenClientFromEnvironment
import com.github.navikt.tbd_libs.kafka.AivenConfig
import com.github.navikt.tbd_libs.kafka.ConsumerProducerFactory
import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection
import com.github.navikt.tbd_libs.spedisjon.SpedisjonClient
import com.github.navikt.tbd_libs.speed.SpeedClient
import java.net.http.HttpClient
import no.nav.helse.rapids_rivers.RapidApplication
import no.nav.helse.sporbar.sis.BehandlingForkastetRiver
import no.nav.helse.sporbar.sis.BehandlingLukketRiver
import no.nav.helse.sporbar.sis.BehandlingOpprettetRiver
import no.nav.helse.sporbar.sis.KafkaSisPublisher
import no.nav.helse.sporbar.sis.VedtaksperiodeVenterRiver
import no.nav.helse.sporbar.sis.*
import org.slf4j.LoggerFactory
import java.net.http.HttpClient

val objectMapper: ObjectMapper = jacksonObjectMapper()
.registerModule(JavaTimeModule())
Expand All @@ -36,13 +31,6 @@ fun main() {
fun launchApplication(env: Map<String, String>) {
val factory = ConsumerProducerFactory(AivenConfig.default)
RapidApplication.create(env, factory).apply {
val dataSourceBuilder = DataSourceBuilder()
register(object : RapidsConnection.StatusListener {
override fun onStartup(rapidsConnection: RapidsConnection) {
dataSourceBuilder.migrate()
}
})

val azureClient = createAzureTokenClientFromEnvironment(env)
val speedClient = SpeedClient(
httpClient = HttpClient.newHttpClient(),
Expand All @@ -55,7 +43,6 @@ fun launchApplication(env: Map<String, String>) {
tokenProvider = azureClient
)

val dokumentDao = DokumentDao(dataSourceBuilder::dataSource)
val aivenProducer = factory.createProducer()

val vedtakFattetMediator = VedtakFattetMediator(
Expand All @@ -64,7 +51,6 @@ fun launchApplication(env: Map<String, String>) {
)
val utbetalingMediator = UtbetalingMediator(aivenProducer)

NyttDokumentRiver(this, dokumentDao)
VedtakFattetRiver(this, vedtakFattetMediator, speedClient)
VedtaksperiodeAnnullertRiver(this, aivenProducer, speedClient)
UtbetalingUtbetaltRiver(this, utbetalingMediator, speedClient)
Expand Down
52 changes: 0 additions & 52 deletions src/main/kotlin/no/nav/helse/sporbar/DataSourceBuilder.kt

This file was deleted.

54 changes: 0 additions & 54 deletions src/main/kotlin/no/nav/helse/sporbar/DokumentDao.kt

This file was deleted.

68 changes: 0 additions & 68 deletions src/main/kotlin/no/nav/helse/sporbar/NyttDokumentRiver.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime
import java.time.OffsetDateTime
import java.time.ZoneId
import java.util.UUID
import no.nav.helse.sporbar.Dokument
import no.nav.helse.sporbar.DokumentDao

data class Behandlingstatusmelding(
val vedtaksperiodeId: UUID,
Expand Down Expand Up @@ -34,8 +32,5 @@ data class Behandlingstatusmelding(

private val Oslo = ZoneId.of("Europe/Oslo")
internal fun JsonNode.asOffsetDateTime() = asLocalDateTime().atZone(Oslo).toOffsetDateTime()

internal fun DokumentDao.eksterneSøknadIder(interneHendelseIder: List<UUID>) =
finn(interneHendelseIder).filter { it.type == Dokument.Type.Søknad }.map { it.dokumentId }.toSet().takeUnless { it.isEmpty() }
}
}
18 changes: 0 additions & 18 deletions src/main/resources/db/migration/V10__inntektsmelding_status.sql

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/db/migration/V14__spesialsak.sql

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/db/migration/V16__fjern_spesialsak.sql

This file was deleted.

Loading

0 comments on commit e099787

Please sign in to comment.