-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
371 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...pdrag/simulering/SimuleringSoapBuilder.kt → ...nfrastructure/soap/SoapEnvelopeBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...ure/src/main/kotlin/tilbakekreving/infrastructure/client/TilbakekrevingSoapBodyBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
@file:Suppress("HttpUrlsUsage") | ||
|
||
package tilbakekreving.infrastructure.client | ||
|
||
import no.nav.su.se.bakover.common.ident.NavIdentBruker | ||
import tilbakekreving.domain.vurdering.PeriodevurderingMedKrav | ||
import tilbakekreving.domain.vurdering.VurderingerMedKrav | ||
import tilbakekreving.infrastructure.client.dto.AksjonsKode | ||
import tilbakekreving.infrastructure.client.dto.Skyld | ||
import tilbakekreving.infrastructure.client.dto.TilbakekrevingsHjemmel | ||
import tilbakekreving.infrastructure.client.dto.Tilbakekrevingsresultat | ||
import tilbakekreving.infrastructure.client.dto.TilbakekrevingsÅrsak | ||
import kotlin.math.max | ||
|
||
/** | ||
* Se: https://confluence.adeo.no/display/OKSY/Detaljer+om+de+enkelte+ID-koder | ||
* Se: https://github.com/navikt/tjenestespesifikasjoner/blob/master/tilbakekreving-v1-tjenestespesifikasjon/src/main/wsdl/no/nav/tilbakekreving/tilbakekreving-v1-tjenestespesifikasjon.wsdl | ||
*/ | ||
internal fun buildTilbakekrevingSoapRequest( | ||
vurderingerMedKrav: VurderingerMedKrav, | ||
attestertAv: NavIdentBruker.Attestant, | ||
): String { | ||
// TODO jah: Vurder om vi skal legge til datoVedtakFagsystem istedenfor å få dagens dato. | ||
return """ | ||
<ns4:tilbakekrevingsvedtakRequest xmlns:ns2="urn:no:nav:tilbakekreving:typer:v1" | ||
xmlns:ns4="http://okonomi.nav.no/tilbakekrevingService/" | ||
xmlns:ns3="urn:no:nav:tilbakekreving:tilbakekrevingsvedtak:vedtak:v1"> | ||
<tilbakekrevingsvedtak> | ||
<ns3:kodeAksjon>${AksjonsKode.FATT_VEDTAK.nummer}</ns3:kodeAksjon> | ||
<ns3:vedtakId>${vurderingerMedKrav.eksternVedtakId}</ns3:vedtakId> | ||
<ns3:kodeHjemmel>${TilbakekrevingsHjemmel.T}</ns3:kodeHjemmel> | ||
<ns3:renterBeregnes>N</ns3:renterBeregnes> | ||
<ns3:enhetAnsvarlig>8020</ns3:enhetAnsvarlig> | ||
<ns3:kontrollfelt>${vurderingerMedKrav.eksternKontrollfelt}</ns3:kontrollfelt> | ||
<ns3:saksbehId>$attestertAv</ns3:saksbehId> | ||
${ | ||
vurderingerMedKrav.perioder.joinToString(separator = "\n") { periode -> | ||
""" | ||
<ns3:tilbakekrevingsperiode> | ||
<ns3:periode> | ||
<ns2:fom>${periode.periode.fraOgMed}</ns2:fom> | ||
<ns2:tom>${periode.periode.tilOgMed}</ns2:tom> | ||
</ns3:periode> | ||
<ns3:renterBeregnes>N</ns3:renterBeregnes> | ||
<ns3:belopRenter>0</ns3:belopRenter> | ||
<ns3:tilbakekrevingsbelop> | ||
<ns3:kodeKlasse>SUUFORE</ns3:kodeKlasse> | ||
<ns3:belopOpprUtbet>${periode.bruttoTidligereUtbetalt}</ns3:belopOpprUtbet> | ||
<ns3:belopNy>${periode.bruttoNyUtbetaling}</ns3:belopNy> | ||
<ns3:belopTilbakekreves>${periode.bruttoSkalTilbakekreve}}</ns3:belopTilbakekreves> | ||
<ns3:belopUinnkrevd>${periode.bruttoSkalIkkeTilbakekreve}</ns3:belopUinnkrevd> | ||
<ns3:belopSkatt>${periode.skattSomGårTilReduksjon}</ns3:belopSkatt> | ||
<ns3:kodeResultat>${ | ||
when (periode) { | ||
is PeriodevurderingMedKrav.SkalIkkeTilbakekreve -> Tilbakekrevingsresultat.INGEN_TILBAKEKREV.toString() | ||
is PeriodevurderingMedKrav.SkalTilbakekreve -> Tilbakekrevingsresultat.FULL_TILBAKEKREV.toString() | ||
} | ||
}</ns3:kodeResultat> | ||
<ns3:kodeAarsak>${TilbakekrevingsÅrsak.ANNET}</ns3:kodeAarsak> | ||
<ns3:kodeSkyld>${ | ||
when (periode) { | ||
is PeriodevurderingMedKrav.SkalIkkeTilbakekreve -> Skyld.IKKE_FORDELT.toString() | ||
is PeriodevurderingMedKrav.SkalTilbakekreve -> Skyld.BRUKER.toString() | ||
} | ||
}</ns3:kodeSkyld> | ||
</ns3:tilbakekrevingsbelop> | ||
<ns3:tilbakekrevingsbelop> | ||
<ns3:kodeKlasse>KL_KODE_FEIL_INNT</ns3:kodeKlasse> | ||
<ns3:belopOpprUtbet>0</ns3:belopOpprUtbet> | ||
<ns3:belopNy>${max(periode.bruttoSkalTilbakekreve, periode.bruttoSkalIkkeTilbakekreve)}</ns3:belopNy> | ||
<ns3:belopTilbakekreves>0</ns3:belopTilbakekreves> | ||
<ns3:belopUinnkrevd>0</ns3:belopUinnkrevd> | ||
</ns3:tilbakekrevingsbelop> | ||
</ns3:tilbakekrevingsperiode>""" | ||
} | ||
} | ||
</tilbakekrevingsvedtak> | ||
</ns4:tilbakekrevingsvedtakRequest> | ||
""".trimIndent() | ||
} |
Oops, something went wrong.