Skip to content

Commit

Permalink
Fjern unødvendig logging
Browse files Browse the repository at this point in the history
  • Loading branch information
androa committed Jan 23, 2025
1 parent 6e46db7 commit bca7037
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,22 @@ internal class InntektNesteMånedService(
) {
val prøvingsdato = packet["Virkningstidspunkt"].asLocalDate()
val inntektsrapporteringsperiode = Inntektsrapporteringperiode(prøvingsdato)
val nestePrøvingsdato = inntektsrapporteringsperiode.neste().fom()
log.info { "Henter klassifisert inntekt på $nestePrøvingsdato. Opprinnelig prøvingsdato var $prøvingsdato" }
val nesteInntektsrapporteringsperiode = inntektsrapporteringsperiode.neste()
val inntekt =
runBlocking {
inntektClient.hentKlassifisertInntekt(
behandlingId = behandlingId,
fødselsnummer = packet["ident"].asText(),
prøvingsdato = nestePrøvingsdato,
prøvingsdato = nesteInntektsrapporteringsperiode.fom(),
callId = callId,
)
}

log.info {
"""
|Inntekter dekker fram til og med ${inntekt.sisteAvsluttendeKalenderMåned}. Sjekker om det
|ligger inntekt for inntektsperiode med
|fom=${inntektsrapporteringsperiode.fom()}, tom=${inntektsrapporteringsperiode.tom()}
|
""".trimMargin()
}
val løsning =
packet["@behov"]
.map { it.asText() }
.filter { it in løserBehov }.associateWith { behov ->
.filter { it in løserBehov }
.associateWith { behov ->
when (behov) {
"HarRapportertInntektNesteMåned" ->
inntekt.harInntektFor(inntektsrapporteringsperiode.fom())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,15 @@ internal class InntektNesteMånedServiceTest {
@Test
fun `skal sjekke om det finnes inntekt for neste måned`() {
val inntekt =

Inntekt(
"123",
listOf(
KlassifisertInntektMåned(
YearMonth.of(2020, 11),
listOf(KlassifisertInntekt(BigDecimal.ONE, InntektKlasse.ARBEIDSINNTEKT)),
),
KlassifisertInntektMåned(
YearMonth.of(2020, 12),
listOf(KlassifisertInntekt(BigDecimal.ONE, InntektKlasse.ARBEIDSINNTEKT)),
),
KlassifisertInntektMåned(
YearMonth.of(2021, 5),
YearMonth.of(2021, 4),
listOf(KlassifisertInntekt(BigDecimal.ONE, InntektKlasse.ARBEIDSINNTEKT)),
),
),
sisteAvsluttendeKalenderMåned = YearMonth.of(2021, 3),
sisteAvsluttendeKalenderMåned = YearMonth.of(2021, 4),
)

val inntektClient =
Expand All @@ -54,7 +45,7 @@ internal class InntektNesteMånedServiceTest {
it.hentKlassifisertInntekt(
behandlingId = behandlingId,
fødselsnummer = "12345678911",
prøvingsdato = LocalDate.parse("2021-06-08"),
prøvingsdato = LocalDate.parse("2021-05-06"),
callId = any(),
)
} returns inntekt
Expand All @@ -75,34 +66,9 @@ internal class InntektNesteMånedServiceTest {
"@opprettet": "2021-11-18T11:04:32.867824",
"@id": "930e2beb-d394-4024-b713-dbeb6ad3d4bf",
"@behovId": "930e2beb-d394-4024-b713-dbeb6ad3d4bf",
"Virkningstidspunkt": "2021-05-06",
"behandlingId" : "$behandlingId",
"ident" : "12345678911",
"FangstOgFiske": false,
"fakta": [
{
"id": "9",
"behov": "HarRapportertInntektNesteMåned"
}
],
"@behov": [
"InntektSiste12Mnd", "InntektSiste3År", "HarRapportertInntektNesteMåned"
]
}
""".trimIndent()

// language=JSON
private val behovUtenIdent =
"""
{
"@event_name": "faktum_svar",
"@opprettet": "2021-11-18T11:04:32.867824",
"@id": "930e2beb-d394-4024-b713-dbeb6ad3d4bf",
"@behovId": "930e2beb-d394-4024-b713-dbeb6ad3d4bf",
"Virkningstidspunkt": "2021-05-06",
"Virkningstidspunkt": "2021-05-02",
"behandlingId" : "$behandlingId",
"ident" : "12345678911",
"identer":[],
"FangstOgFiske": false,
"fakta": [
{
Expand Down

0 comments on commit bca7037

Please sign in to comment.