Skip to content

Commit

Permalink
f - Sletter lokal updateSEDVersion(), og bruker setSEDVersion() fra e…
Browse files Browse the repository at this point in the history
…p-eux
  • Loading branch information
MariamPervez committed Aug 22, 2024
1 parent e97e83f commit 8074ba7
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/main/kotlin/no/nav/eessi/pensjon/prefill/PrefillService.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package no.nav.eessi.pensjon.prefill

import io.micrometer.core.instrument.Metrics
import no.nav.eessi.pensjon.eux.model.SedType
import no.nav.eessi.pensjon.eux.model.sed.SED
import no.nav.eessi.pensjon.eux.model.sed.SED.Companion.setSEDVersion
import no.nav.eessi.pensjon.metrics.MetricsHelper
import no.nav.eessi.pensjon.prefill.models.PensjonCollection
import no.nav.eessi.pensjon.prefill.sed.PrefillSEDService
import no.nav.eessi.pensjon.shared.api.ApiRequest
import no.nav.eessi.pensjon.statistikk.AutomatiseringStatistikkService
Expand All @@ -23,13 +21,9 @@ class PrefillService(
private val automatiseringStatistikkService: AutomatiseringStatistikkService,
@Autowired(required = false) private val metricsHelper: MetricsHelper = MetricsHelper.ForTest()
) {

private val logger = LoggerFactory.getLogger(PrefillService::class.java)

private lateinit var PrefillSed: MetricsHelper.Metric

private val LATEST_RINA_SED_VERSION = "v4.2"

init {
PrefillSed = metricsHelper.init("PrefillSed",
ignoreHttpCodes = listOf(HttpStatus.BAD_REQUEST, HttpStatus.FORBIDDEN))
Expand Down Expand Up @@ -61,7 +55,7 @@ class PrefillService(
logger.debug("Sed ferdig utfylt: $sed")

//synk sed versjon med buc versjon
updateSEDVersion(sed, LATEST_RINA_SED_VERSION)
setSEDVersion(sed.sedVer)

try {
Metrics.counter("Sed_Prefill","type", sed.type.name).increment()
Expand All @@ -82,12 +76,4 @@ class PrefillService(
}
}

//flyttes til prefill / en eller annen service?
private fun updateSEDVersion(sed: SED, bucVersion: String) {
when(bucVersion) {
"v4.2" -> sed.sedVer="2"
else -> sed.sedVer="1"
}
logger.debug("SED version: v${sed.sedGVer}.${sed.sedVer} + BUC version: $bucVersion")
}
}

0 comments on commit 8074ba7

Please sign in to comment.