From 233f8b899c735b6a50d21bdaedc6861ebd961b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20N=2E=20Wed=C3=B8e?= Date: Fri, 12 Jul 2024 13:55:49 +0200 Subject: [PATCH] Make input required. --- .../klage/dokument/api/view/PreviewSvarbrevInput.kt | 6 +++--- .../klage/dokument/service/SvarbrevPreviewService.kt | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/no/nav/klage/dokument/api/view/PreviewSvarbrevInput.kt b/src/main/kotlin/no/nav/klage/dokument/api/view/PreviewSvarbrevInput.kt index 3eb63def2..1e09286ad 100644 --- a/src/main/kotlin/no/nav/klage/dokument/api/view/PreviewSvarbrevInput.kt +++ b/src/main/kotlin/no/nav/klage/dokument/api/view/PreviewSvarbrevInput.kt @@ -21,7 +21,7 @@ data class PreviewSvarbrevInput( data class PreviewSvarbrevAnonymousInput( val ytelseId: String, val typeId: String, - val behandlingstidUnits: Int?, - val behandlingstidUnitType: SvarbrevSettings.BehandlingstidUnitType?, - val customText: String?, + val behandlingstidUnits: Int, + val behandlingstidUnitType: SvarbrevSettings.BehandlingstidUnitType, + val customText: String, ) \ No newline at end of file diff --git a/src/main/kotlin/no/nav/klage/dokument/service/SvarbrevPreviewService.kt b/src/main/kotlin/no/nav/klage/dokument/service/SvarbrevPreviewService.kt index 6b6fd3b31..db439a276 100644 --- a/src/main/kotlin/no/nav/klage/dokument/service/SvarbrevPreviewService.kt +++ b/src/main/kotlin/no/nav/klage/dokument/service/SvarbrevPreviewService.kt @@ -8,7 +8,6 @@ import no.nav.klage.kodeverk.Enhet import no.nav.klage.kodeverk.Type import no.nav.klage.kodeverk.Ytelse import no.nav.klage.oppgave.service.PartSearchService -import no.nav.klage.oppgave.service.SvarbrevSettingsService import no.nav.klage.oppgave.util.getLogger import org.springframework.stereotype.Service import java.time.LocalDate @@ -17,7 +16,6 @@ import java.time.LocalDate class SvarbrevPreviewService( private val partSearchService: PartSearchService, private val kabalJsonToPdfService: KabalJsonToPdfService, - private val svarbrevSettingsService: SvarbrevSettingsService, ) { companion object { @@ -62,7 +60,7 @@ class SvarbrevPreviewService( if (input.typeId !in listOf(Type.KLAGE.id, Type.ANKE.id)) { throw SvarbrevPreviewException("Forhåndsvisning av svarbrev er bare tilgjengelig for Klage og Anke.") } - val svarbrevSettings = svarbrevSettingsService.getSvarbrevSettingsForYtelseAndType(ytelse = Ytelse.of(input.ytelseId), type = Type.of(input.typeId)) + val mockName = "Navn Navnesen" val mockIdentifikator = "123456789101" @@ -71,10 +69,10 @@ class SvarbrevPreviewService( title = "NAV orienterer om saksbehandlingen", receivers = listOf(), fullmektigFritekst = null, - varsletBehandlingstidUnits = input.behandlingstidUnits ?: svarbrevSettings.behandlingstidUnits, - varsletBehandlingstidUnitType = input.behandlingstidUnitType ?: svarbrevSettings.behandlingstidUnitType, + varsletBehandlingstidUnits = input.behandlingstidUnits, + varsletBehandlingstidUnitType = input.behandlingstidUnitType, type = Type.of(input.typeId), - customText = input.customText ?: svarbrevSettings.customText, + customText = input.customText, ), mottattKlageinstans = LocalDate.now(), sakenGjelderIdentifikator = mockIdentifikator,