-
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.
Opprett grunnlagsobjekter for vedtak og beregning (#51)
- Loading branch information
Showing
30 changed files
with
756 additions
and
321 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
23 changes: 17 additions & 6 deletions
23
bidrag-domene/src/main/kotlin/no/nav/bidrag/domene/enums/beregning/ResultatkodeForskudd.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,20 @@ | ||
package no.nav.bidrag.domene.enums.beregning | ||
|
||
enum class ResultatkodeForskudd { | ||
AVSLAG, | ||
REDUSERT_FORSKUDD_50_PROSENT, | ||
ORDINÆRT_FORSKUDD_75_PROSENT, | ||
FORHØYET_FORSKUDD_100_PROSENT, | ||
FORHØYET_FORSKUDD_11_ÅR_125_PROSENT, | ||
enum class ResultatkodeForskudd(val legacyKode: String) { | ||
AVSLAG("A"), | ||
REDUSERT_FORSKUDD_50_PROSENT("50"), | ||
ORDINÆRT_FORSKUDD_75_PROSENT("75"), | ||
FORHØYET_FORSKUDD_100_PROSENT("100"), | ||
FORHØYET_FORSKUDD_11_ÅR_125_PROSENT("125"), | ||
; | ||
|
||
companion object { | ||
fun fraKode(kode: String): ResultatkodeForskudd? { | ||
return try { | ||
entries.find { it.legacyKode == kode } ?: ResultatkodeForskudd.valueOf(kode) | ||
} catch (e: Exception) { | ||
null | ||
} | ||
} | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
...ag-domene/src/main/kotlin/no/nav/bidrag/domene/enums/beregning/ResultatkodeSærtilskudd.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,7 +1,7 @@ | ||
package no.nav.bidrag.domene.enums.beregning | ||
|
||
enum class ResultatkodeSærtilskudd { | ||
BARNET_ER_SELVFORSØRGET, // Barnet er selvforsørget | ||
SÆRTILSKUDD_INNVILGET, // Resultat av beregning av særtilskudd | ||
SÆRTILSKUDD_IKKE_FULL_BIDRAGSEVNE, // Resultat av beregning av særtilskudd | ||
enum class ResultatkodeSærtilskudd(val kode: String) { | ||
BARNET_ER_SELVFORSØRGET("5SF"), // Barnet er selvforsørget | ||
SÆRTILSKUDD_INNVILGET("VS"), // Resultat av beregning av særtilskudd | ||
SÆRTILSKUDD_IKKE_FULL_BIDRAGSEVNE("6MB"), // Resultat av beregning av særtilskudd | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...ort/src/main/kotlin/no/nav/bidrag/transport/behandling/beregning/felles/BeregnGrunnlag.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,17 @@ | ||
package no.nav.bidrag.transport.behandling.beregning.felles | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
import no.nav.bidrag.domene.tid.ÅrMånedsperiode | ||
import no.nav.bidrag.transport.behandling.felles.grunnlag.GrunnlagDto | ||
|
||
@Schema(description = "Grunnlaget for en beregning av barnebidrag, forskudd og særtilskudd") | ||
data class BeregnGrunnlag( | ||
@Schema(description = "Beregningsperiode") val periode: ÅrMånedsperiode, | ||
@Schema(description = "Referanse til Person-objekt som tilhører søknadsbarnet") val søknadsbarnReferanse: String, | ||
@Schema(description = "Periodisert liste over grunnlagselementer") val grunnlagListe: List<GrunnlagDto> = emptyList(), | ||
) | ||
|
||
fun BeregnGrunnlag.valider() { | ||
requireNotNull(periode.fom) { "beregningsperiode fom kan ikke være null" } | ||
requireNotNull(periode.til) { "beregningsperiode til kan ikke være null" } | ||
} |
66 changes: 0 additions & 66 deletions
66
bidrag-transport/src/main/kotlin/no/nav/bidrag/transport/behandling/beregning/felles/Dto.kt
This file was deleted.
Oops, something went wrong.
16 changes: 3 additions & 13 deletions
16
...rag/transport/behandling/beregning/felles/grunnlag/BeregningInntektRapporteringPeriode.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,16 +1,6 @@ | ||
package no.nav.bidrag.transport.behandling.beregning.felles.grunnlag | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
import no.nav.bidrag.domene.enums.inntekt.Inntektsrapportering | ||
import no.nav.bidrag.domene.tid.ÅrMånedsperiode | ||
import java.math.BigDecimal | ||
import no.nav.bidrag.transport.behandling.felles.grunnlag.InntektsrapporteringPeriode | ||
|
||
@Schema(description = "Rapportert inntekt for person") | ||
data class BeregningInntektRapporteringPeriode( | ||
@Schema(description = "Periode") val periode: ÅrMånedsperiode, | ||
@Schema(description = "Type inntektsrapportering") val inntektsrapportering: Inntektsrapportering, | ||
@Schema(description = "Referanse til barnet inntekten gjelder for") val gjelderBarn: String? = null, | ||
@Schema(description = "Inntekt beløp") val beløp: BigDecimal, | ||
@Schema(description = "Er registrert manuelt?") val manueltRegistrert: Boolean, | ||
@Schema(description = "Skal være del av beregning?") val valgt: Boolean, | ||
) | ||
@Deprecated("Bruk InntektsrapporteringPeriode", ReplaceWith("InntektsrapporteringPeriode")) | ||
typealias BeregningInntektRapporteringPeriode = InntektsrapporteringPeriode |
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.