Skip to content

Commit

Permalink
Delete debug logs, todos
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitenok committed Nov 15, 2023
1 parent e429562 commit 1f69289
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion nais/nais-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ spec:
- name: BASE_URL_DOKUMENTARKIV_OPPFOLGING_DOCUMENTS_PAGE
value: https://www.nav.no/dokumentarkiv/tema/OPP
- name: URL_AKTIVITETSKRAV_INFO_PAGE
value: https://www.nav.no/syk/aktivitetskrav
value: https://www.nav.no/syk/aktivitetskrav
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class AktivitetspliktForhandsvarselVarselService(
val urlAktivitetskravInfoPage: String,
private val isSendingEnabled: Boolean,
) {
// TODO
fun sendVarselTilArbeidstaker(varselHendelse: ArbeidstakerHendelse) {
if (isSendingEnabled) {
log.info("[FORHAANDSVARSEL] sending enabled")
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/no/nav/syfo/service/SenderFacade.kt
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ class SenderFacade(
}

private fun ferdigstillVarsel(utsendtVarsel: PUtsendtVarsel) {
log.info("[FORHAANDSVARSEL] Fetched utsendt varsel from DB. About to ferdigstill. fnr:${utsendtVarsel.fnr}, uuid: ${utsendtVarsel.uuid}, eksternReferanse: ${utsendtVarsel.eksternReferanse}")
if (utsendtVarsel.eksternReferanse != null && utsendtVarsel.ferdigstiltTidspunkt == null) {
when (utsendtVarsel.kanal) {
BRUKERNOTIFIKASJON.name -> {
Expand Down
3 changes: 0 additions & 3 deletions src/main/kotlin/no/nav/syfo/service/VarselBusService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ class VarselBusService(

fun ferdigstillVarsel(varselHendelse: EsyfovarselHendelse) {
if (varselHendelse.isArbeidstakerHendelse()) {
if (varselHendelse.type == SM_AKTIVITETSPLIKT) {
log.info("[FORHAANDSVARSEL] skal ferdigstille varsel av type ${varselHendelse.type}")
}
senderFacade.ferdigstillArbeidstakerVarsler(varselHendelse.toArbeidstakerHendelse())
} else {
senderFacade.ferdigstillNarmesteLederVarsler(varselHendelse.toNarmestelederHendelse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@ import no.nav.syfo.db.domain.PMikrofrontendSynlighet
import no.nav.syfo.db.fetchFnrsWithExpiredMicrofrontendEntries
import no.nav.syfo.db.fetchMikrofrontendSynlighetEntriesByFnr
import no.nav.syfo.db.updateMikrofrontendEntrySynligTomByFnrAndTjeneste
import no.nav.syfo.kafka.consumers.varselbus.domain.*
import no.nav.syfo.kafka.consumers.varselbus.domain.ArbeidstakerHendelse
import no.nav.syfo.kafka.consumers.varselbus.domain.getSynligTom
import no.nav.syfo.kafka.producers.mineside_microfrontend.MinSideRecord
import no.nav.syfo.kafka.producers.mineside_microfrontend.Tjeneste
import no.nav.syfo.service.microfrontend.MikrofrontendService.Companion.actionEnabled
import no.nav.syfo.utils.dataToVarselData
import org.slf4j.Logger
import org.slf4j.LoggerFactory

class MikrofrontendAktivitetskravService(val database: DatabaseInterface) {
val mikrofrontendId = "syfo-aktivitetskrav"
private val log: Logger = LoggerFactory.getLogger(MikrofrontendAktivitetskravService::class.qualifiedName)

fun createOrUpdateAktivitetskravMicrofrontendByHendelse(hendelse: ArbeidstakerHendelse): MinSideRecord? {
return createOrUpdateMinSideRecord(hendelse)
}

private fun createOrUpdateMinSideRecord(hendelse: ArbeidstakerHendelse): MinSideRecord? {
val isMikrofrontendActiveForUser =
existingMikrofrontendEntries(hendelse.arbeidstakerFnr, Tjeneste.AKTIVITETSKRAV).isNotEmpty()
log.warn("[FORHAANDSVARSEL] hendelse data: ${hendelse.data} || ${hendelse.data}")
existingMikrofrontendEntries(hendelse.arbeidstakerFnr).isNotEmpty()
val actions = dataToVarselData(hendelse.data).aktivitetskrav
requireNotNull(actions)

Expand Down Expand Up @@ -55,8 +53,8 @@ class MikrofrontendAktivitetskravService(val database: DatabaseInterface) {
.map { Triple(it, mikrofrontendId, Tjeneste.AKTIVITETSKRAV) }
}

private fun existingMikrofrontendEntries(fnr: String, tjeneste: Tjeneste): List<PMikrofrontendSynlighet> {
private fun existingMikrofrontendEntries(fnr: String): List<PMikrofrontendSynlighet> {
return database.fetchMikrofrontendSynlighetEntriesByFnr(fnr)
.filter { it.tjeneste == tjeneste.name }
.filter { it.tjeneste == Tjeneste.AKTIVITETSKRAV.name }
}
}

0 comments on commit 1f69289

Please sign in to comment.