Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete unused code #450

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PdfgenConsumer(urlEnv: UrlEnv, val pdlConsumer: PdlConsumer, val databaseI
suspend fun getMerVeiledningPDF(fnr: String, isBrukerReservert: Boolean): ByteArray? {
val mottakerNavn = pdlConsumer.hentPerson(fnr)?.getFullNameAsString()
val sykepengerMaxDate = databaseInterface.fetchMaksDatoByFnr(fnr)
val merVeiledningPdfUrl = syfooppdfgenUrl + "/api/v1/genpdf/oppfolging/mer_veiledning"
val merVeiledningPdfUrl = "$syfooppdfgenUrl/api/v1/genpdf/oppfolging/mer_veiledning"
val request = getPdfgenRequest(
mottakerNavn,
sykepengerMaxDate?.utbetalt_tom,
Expand Down
11 changes: 0 additions & 11 deletions src/main/kotlin/no/nav/syfo/consumer/pdl/PdlResponse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,6 @@ data class PdlErrorExtension(
val classification: String
)

fun PdlHentPerson.isKode6Eller7(): Boolean {
val adressebeskyttelse = this.hentPerson?.adressebeskyttelse
return if (adressebeskyttelse.isNullOrEmpty()) {
false
} else {
return adressebeskyttelse.any {
it.isKode6() || it.isKode7()
}
}
}

fun Adressebeskyttelse.isKode6(): Boolean {
return this.gradering == Gradering.STRENGT_FORTROLIG || this.gradering == Gradering.STRENGT_FORTROLIG_UTLAND
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/kotlin/no/nav/syfo/db/domain/PlanlagtVarsel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ enum class VarselType {
MER_VEILEDNING
}

const val UTSENDING_FEILET = "UTSENDING_FEILET"

data class PlanlagtVarsel(
val fnr: String,
val aktorId: String,
Expand Down
10 changes: 0 additions & 10 deletions src/main/kotlin/no/nav/syfo/metrics/AppMetrics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const val METRICS_NS = "esyfovarsel"

const val MER_VEILEDNING_NOTICE_SENT = "${METRICS_NS}_mer_veiledning_notice_sent"
const val SVAR_MOTEBEHOV_NOTICE_SENT = "${METRICS_NS}_svar_motebehov_notice_sent"
const val AKTIVITETSKRAV_NOTICE_SENT = "${METRICS_NS}_aktivitetskrav_isyfo_sent"
const val NOTICE_SENT = "${METRICS_NS}_notice_sent"

val METRICS_REGISTRY =
Expand All @@ -36,11 +35,6 @@ val COUNT_ALL_NOTICE_SENT: Counter = Counter
.description("Counts the number of all types of notice sent")
.register(METRICS_REGISTRY)

val COUNT_AKTIVIETSKRAV_ISYFO_SENT: Counter = Counter
.builder(AKTIVITETSKRAV_NOTICE_SENT)
.description("Counts the number of aktivitetskrav from isyfo sent")
.register(METRICS_REGISTRY)

fun tellMerVeiledningVarselSendt(varslerSendt: Int) {
COUNT_ALL_NOTICE_SENT.increment(varslerSendt.toDouble())
COUNT_MER_VEILEDNING_NOTICE_SENT.increment(varslerSendt.toDouble())
Expand All @@ -51,10 +45,6 @@ fun tellSvarMotebehovVarselSendt(varslerSendt: Int) {
COUNT_SVAR_MOTEBEHOV_NOTICE_SENT.increment(varslerSendt.toDouble())
}

fun tellAktivitetskravFraIsAktivitetskrav() {
COUNT_AKTIVIETSKRAV_ISYFO_SENT.increment()
}

fun Routing.registerPrometheusApi() {
DefaultExports.initialize()

Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ class ArbeidsgiverNotifikasjonService(
return
}

if (arbeidsgiverNotifikasjon.narmesteLederFnr !== null && !arbeidsgiverNotifikasjon.narmesteLederFnr.equals(
narmesteLederRelasjon.narmesteLederFnr
)
) {
if (arbeidsgiverNotifikasjon.narmesteLederFnr !== null && arbeidsgiverNotifikasjon.narmesteLederFnr != narmesteLederRelasjon.narmesteLederFnr) {
log.warn("Sender ikke varsel til ag-notifikasjon: den ansatte har nærmeste leder med annet fnr enn mottaker i varselHendelse")
return
}
Expand Down
13 changes: 0 additions & 13 deletions src/main/kotlin/no/nav/syfo/utils/DateUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,10 @@ import java.time.format.DateTimeFormatter

private const val BREV_DATE_FORMAT_PATTERN = "dd. MMMM yyyy"

fun LocalDate.isEqualOrAfter(other: LocalDate): Boolean {
return this == other || this.isAfter(other)
}

fun LocalDate.isEqualOrBefore(other: LocalDate): Boolean {
return this == other || this.isBefore(other)
}

fun todayIsBetweenFomAndTom(fom: LocalDate, tom: LocalDate): Boolean {
val today = LocalDate.now()
return dateIsInInterval(today, fom, tom)
}

fun dateIsInInterval(date: LocalDate, start: LocalDate, end: LocalDate): Boolean {
return date.isEqualOrAfter(start) && date.isEqualOrBefore(end)
}

fun parseDate(date: String): LocalDate {
val formatter = DateTimeFormatter.ofPattern("yyyyMMdd")
return LocalDate.parse(date, formatter)
Expand Down
32 changes: 0 additions & 32 deletions src/test/kotlin/no/nav/syfo/db/TestUtil.kt

This file was deleted.

3 changes: 0 additions & 3 deletions src/test/kotlin/no/nav/syfo/testutil/Utils.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package no.nav.syfo.testutil

import no.nav.syfo.db.DatabaseInterface
import no.nav.syfo.db.domain.PPlanlagtVarsel
import no.nav.syfo.db.domain.VarselType
import no.nav.syfo.db.fetchMikrofrontendSynlighetEntriesByFnr
import no.nav.syfo.kafka.producers.mineside_microfrontend.Tjeneste
import org.amshove.kluent.should
import java.time.LocalDate

fun String.extractPortFromUrl(): Int {
val portIndexStart = lastIndexOf(':') + 1
Expand Down
Loading