Skip to content

Commit

Permalink
bruk predefinert fnrdto
Browse files Browse the repository at this point in the history
  • Loading branch information
sebassonav committed Dec 4, 2024
1 parent ada7e17 commit 5a40dee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import io.ktor.server.routing.route
import no.nav.etterlatte.AuthorizationPlugin
import no.nav.etterlatte.libs.common.behandling.SakType
import no.nav.etterlatte.libs.common.person.Folkeregisteridentifikator
import no.nav.etterlatte.libs.ktor.route.FoedselsnummerDTO
import no.nav.etterlatte.libs.ktor.route.dato
import no.nav.etterlatte.libs.ktor.token.Issuer

Expand Down Expand Up @@ -52,13 +53,13 @@ fun Route.barnepensjonVedtakRoute(

post {
val paaDato = call.dato("paaDato") ?: throw ManglerFomDatoException()
val fnr = call.receiveNullable<FoedselsnummerDto>() ?: throw ManglerFoedselsnummerException()
val fnr = call.receiveNullable<FoedselsnummerDTO>() ?: throw ManglerFoedselsnummerException()

val harLoependeBarnepensjonYtelsePaaDato =
try {
samordningVedtakService.harLoependeYtelsePaaDato(
dato = paaDato,
fnr = Folkeregisteridentifikator.of(fnr.value),
fnr = Folkeregisteridentifikator.of(fnr.foedselsnummer),
sakType = SakType.BARNEPENSJON,
context = PensjonContext,
)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import no.nav.etterlatte.AuthorizationPlugin
import no.nav.etterlatte.MaskinportenScopeAuthorizationPlugin
import no.nav.etterlatte.libs.common.behandling.SakType
import no.nav.etterlatte.libs.common.person.Folkeregisteridentifikator
import no.nav.etterlatte.libs.ktor.route.FoedselsnummerDTO
import no.nav.etterlatte.libs.ktor.route.dato
import no.nav.etterlatte.libs.ktor.token.Issuer
import no.nav.etterlatte.libs.ktor.token.hentTokenClaimsForIssuerName
Expand Down Expand Up @@ -87,7 +88,7 @@ fun Route.samordningVedtakRoute(
call.dato("fomDato")
?: call.dato("virkFom")
?: throw ManglerFomDatoException()
val fnr = call.receiveNullable<FoedselsnummerDto>() ?: throw ManglerFoedselsnummerException()
val fnr = call.receiveNullable<FoedselsnummerDTO>() ?: throw ManglerFoedselsnummerException()
val tpnummer =
call.request.headers["tpnr"]
?: throw ManglerTpNrException()
Expand All @@ -96,7 +97,7 @@ fun Route.samordningVedtakRoute(
try {
samordningVedtakService.hentVedtaksliste(
fomDato = fomDato,
fnr = Folkeregisteridentifikator.of(fnr.value),
fnr = Folkeregisteridentifikator.of(fnr.foedselsnummer),
context =
MaskinportenTpContext(
tpnr = Tjenestepensjonnummer(tpnummer),
Expand Down Expand Up @@ -149,13 +150,13 @@ fun Route.samordningVedtakRoute(
?: call.dato("virkFom")
?: throw ManglerFomDatoException()

val fnr = call.receiveNullable<FoedselsnummerDto>() ?: throw ManglerFoedselsnummerException()
val fnr = call.receiveNullable<FoedselsnummerDTO>() ?: throw ManglerFoedselsnummerException()

val samordningVedtakDtos =
try {
samordningVedtakService.hentVedtaksliste(
fomDato = fomDato,
fnr = Folkeregisteridentifikator.of(fnr.value),
fnr = Folkeregisteridentifikator.of(fnr.foedselsnummer),
context = PensjonContext,
)
} catch (e: IllegalArgumentException) {
Expand Down Expand Up @@ -190,13 +191,13 @@ fun Route.samordningVedtakRoute(

post("/har-loepende-oms") {
val paaDato = call.dato("paaDato") ?: throw ManglerPaaDatoException()
val fnr = call.receiveNullable<FoedselsnummerDto>() ?: throw ManglerFoedselsnummerException()
val fnr = call.receiveNullable<FoedselsnummerDTO>() ?: throw ManglerFoedselsnummerException()

val harLoependeOmsPaaDato =
try {
samordningVedtakService.harLoependeYtelsePaaDato(
dato = paaDato,
fnr = Folkeregisteridentifikator.of(fnr.value),
fnr = Folkeregisteridentifikator.of(fnr.foedselsnummer),
sakType = SakType.OMSTILLINGSSTOENAD,
context = PensjonContext,
)
Expand Down

0 comments on commit 5a40dee

Please sign in to comment.