Skip to content

Commit

Permalink
Merge pull request #1 from navikt/gjustering2022
Browse files Browse the repository at this point in the history
Legge inn ny G og gjeldende datoer
  • Loading branch information
gtcno authored May 20, 2022
2 parents f0b301f + 0eb4b91 commit a361a7e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/kotlin/no/nav/dagpenger/grunnbelop/Grunnbelop.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import java.time.Month
import java.time.YearMonth

enum class Grunnbeløp(val verdi: BigDecimal, val iverksattFom: LocalDate) {
GjusteringsTest(verdi = 111000.toBigDecimal(), iverksattFom = LocalDate.of(2022, Month.MAY, 1)),
GjusteringsTest(verdi = 111477.toBigDecimal(), iverksattFom = LocalDate.now().plusYears(10)),
FastsattI2022(verdi = 111477.toBigDecimal(), iverksattFom = LocalDate.of(2022, Month.MAY, 21)),
FastsattI2021(verdi = 106399.toBigDecimal(), iverksattFom = LocalDate.of(2021, Month.MAY, 23)),
FastsattI2020(verdi = 101351.toBigDecimal(), iverksattFom = LocalDate.of(2020, Month.SEPTEMBER, 19)),
FastsattI2019(verdi = 99858.toBigDecimal(), iverksattFom = LocalDate.of(2019, Month.MAY, 26)),
Expand Down Expand Up @@ -45,6 +46,15 @@ enum class Regel {

internal val gyldighetsperioder = mapOf(

Grunnbeløp.FastsattI2022 to mapOf(
Regel.Grunnlag to Gyldighetsperiode(
fom = LocalDate.of(2022, Month.MAY, 1)
),
Regel.Minsteinntekt to Gyldighetsperiode(
fom = LocalDate.of(2022, Month.MAY, 23)
)
),

Grunnbeløp.FastsattI2021 to mapOf(
Regel.Grunnlag to Gyldighetsperiode(
fom = LocalDate.of(2021, Month.MAY, 1)
Expand Down
22 changes: 22 additions & 0 deletions src/test/kotlin/no/nav/dagpenger/grunnbelop/GrunnbelopTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,28 @@ import java.time.Month
import java.time.YearMonth

class GrunnbelopTest {

@Test
fun ` Skal returnere grunnbeløp for 2022 etter iverkssatt FOM dato `() {
getGrunnbeløpForRegel(Regel.Grunnlag).forMåned(
dato = YearMonth.of(
2022,
Month.MAY
),
gjeldendeDato = LocalDate.of(2022, 5, 21)
).verdi shouldBe 111477.toBigDecimal()
}

@Test
fun ` Skal returnere grunnbeløp for 2021 dersom gjeldendedato er før iverksatt dato for 2022 G`() {
getGrunnbeløpForRegel(Regel.Grunnlag).forMåned(
dato = YearMonth.of(
2022,
Month.MAY
),
gjeldendeDato = LocalDate.of(2022, 5, 20)
).verdi shouldBe 106399.toBigDecimal()
}
@Test
fun ` Skal returnere grunnbeløp 2021 etter iverkssatt FOM dato `() {
getGrunnbeløpForRegel(Regel.Grunnlag).forMåned(
Expand Down

0 comments on commit a361a7e

Please sign in to comment.