-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from navikt/PEK-715-hente-simulert-tjenestepe…
…nsjon-spk Pek 715 hente simulert tjenestepensjon spk
- Loading branch information
Showing
38 changed files
with
1,207 additions
and
173 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
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
10 changes: 10 additions & 0 deletions
10
...in/no/nav/tjenestepensjon/simulering/v2025/tjenestepensjon/v1/domain/Maanedsutbetaling.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,10 @@ | ||
package no.nav.tjenestepensjon.simulering.v2025.tjenestepensjon.v1.domain | ||
|
||
import no.nav.tjenestepensjon.simulering.model.domain.pen.Alder | ||
import java.time.LocalDate | ||
|
||
data class Maanedsutbetaling( | ||
val fraOgMedDato: LocalDate, | ||
val fraOgMedAlder: Alder, | ||
var maanedsBeloep: Int, | ||
) |
14 changes: 12 additions & 2 deletions
14
...nav/tjenestepensjon/simulering/v2025/tjenestepensjon/v1/domain/SimulertTjenestepensjon.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 |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package no.nav.tjenestepensjon.simulering.v2025.tjenestepensjon.v1.domain | ||
|
||
data class SimulertTjenestepensjon( | ||
open class SimulertTjenestepensjon( | ||
val tpLeverandoer: String, | ||
var ordningsListe: List<Ordning> = emptyList(), | ||
var utbetalingsperioder: List<Utbetalingsperiode> = emptyList(), | ||
var aarsakIngenUtbetaling: List<String> = emptyList(), | ||
val betingetTjenestepensjonErInkludert: Boolean | ||
) | ||
|
||
data class Ordning(val tpNummer: String) | ||
data class Ordning(val tpNummer: String) | ||
|
||
open class SimulertTjenestepensjonMedMaanedsUtbetalinger( | ||
val tpLeverandoer: String, | ||
var ordningsListe: List<Ordning> = emptyList(), | ||
var utbetalingsperioder: List<Maanedsutbetaling> = emptyList(), | ||
var aarsakIngenUtbetaling: List<String> = emptyList(), | ||
val betingetTjenestepensjonErInkludert: Boolean = false | ||
) |
43 changes: 43 additions & 0 deletions
43
.../tjenestepensjon/simulering/v2025/tjenestepensjon/v1/dto/Tjenestepensjon2025Aggregator.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,43 @@ | ||
package no.nav.tjenestepensjon.simulering.v2025.tjenestepensjon.v1.dto | ||
|
||
import no.nav.tjenestepensjon.simulering.v2025.tjenestepensjon.v1.domain.Maanedsutbetaling | ||
import no.nav.tjenestepensjon.simulering.v2025.tjenestepensjon.v1.domain.SimulertTjenestepensjonMedMaanedsUtbetalinger | ||
import no.nav.tjenestepensjon.simulering.v2025.tjenestepensjon.v1.dto.response.* | ||
|
||
object Tjenestepensjon2025Aggregator { | ||
|
||
fun aggregerVellykketRespons(simulertTjenestepensjon: SimulertTjenestepensjonMedMaanedsUtbetalinger, tpOrdninger: List<String>) = | ||
SimulerTjenestepensjonResponseDto( | ||
relevanteTpOrdninger = tpOrdninger, | ||
simuleringsResultatStatus = SimuleringsResultatStatusDto(ResultatTypeDto.SUCCESS), | ||
simuleringsResultat = SimuleringsResultatDto( | ||
tpLeverandoer = simulertTjenestepensjon.tpLeverandoer, | ||
utbetalingsperioder = aggregerTilAarligePerioder(simulertTjenestepensjon.utbetalingsperioder), | ||
betingetTjenestepensjonErInkludert = simulertTjenestepensjon.betingetTjenestepensjonErInkludert | ||
) | ||
) | ||
|
||
fun aggregerTilAarligePerioder(maanedsutbetalinger: List<Maanedsutbetaling>): List<UtbetalingPerAar> { | ||
val aarligeUtbetalinger = mutableMapOf<Int, MutableMap<Int, Int>>() //år -> månedsnummer(1-12) -> beløp for måneden | ||
|
||
maanedsutbetalinger.forEach { maanedsutbetaling -> | ||
val (startAar, startMaaned) = maanedsutbetaling.fraOgMedAlder.let { it.aar to it.maaneder + 1 } | ||
|
||
// Bruk beløp for start år-måned og fremtidige år | ||
(startAar..SISTE_UTBETALINGSAAR).forEach { aar -> | ||
val maanedFra = if (aar == startAar) startMaaned else 1 | ||
aarligeUtbetalinger | ||
.getOrPut(aar) { mutableMapOf() } | ||
.putAll((maanedFra..MAANEDER_I_AAR).associateWith { maanedsutbetaling.maanedsBeloep }) | ||
} | ||
} | ||
|
||
// Summer beløp per år | ||
return aarligeUtbetalinger | ||
.map { (aar, maanedToBeloep) -> UtbetalingPerAar(aar, maanedToBeloep.values.sum()) } | ||
.sortedBy { it.aar } | ||
} | ||
|
||
const val MAANEDER_I_AAR = 12 | ||
const val SISTE_UTBETALINGSAAR = 85 | ||
} |
16 changes: 0 additions & 16 deletions
16
.../nav/tjenestepensjon/simulering/v2025/tjenestepensjon/v1/dto/Tjenestepensjon2025Mapper.kt
This file was deleted.
Oops, something went wrong.
10 changes: 7 additions & 3 deletions
10
...nsjon/simulering/v2025/tjenestepensjon/v1/dto/request/SimulerTjenestepensjonRequestDto.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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package no.nav.tjenestepensjon.simulering.v2025.tjenestepensjon.v1.dto.request | ||
|
||
import java.time.LocalDate | ||
|
||
data class SimulerTjenestepensjonRequestDto( | ||
val fnr: String, | ||
val uttaksListe: List<UttakDto>, | ||
val fremtidigInntektListe: List<FremtidigInntektDto>, | ||
val pid: String, | ||
val foedselsdato: LocalDate, | ||
val uttaksdato: LocalDate, | ||
val sisteInntekt: Int, | ||
val aarIUtlandetEtter16: Int, | ||
val brukerBaOmAfp: Boolean, | ||
val epsPensjon: Boolean, | ||
val eps2G: Boolean, | ||
) |
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
5 changes: 0 additions & 5 deletions
5
...tjenestepensjon/simulering/v2025/tjenestepensjon/v1/dto/response/UtbetalingsperiodeDto.kt
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...av/tjenestepensjon/simulering/v2025/tjenestepensjon/v1/exception/TpregisteretException.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,3 @@ | ||
package no.nav.tjenestepensjon.simulering.v2025.tjenestepensjon.v1.exception | ||
|
||
class TpregisteretException(message: String) : RuntimeException(message) |
42 changes: 29 additions & 13 deletions
42
...jenestepensjon/simulering/v2025/tjenestepensjon/v1/service/TjenestepensjonV2025Service.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
Oops, something went wrong.