Skip to content

Commit

Permalink
Feature/klage (#410)
Browse files Browse the repository at this point in the history
* ger til klagestatistikk

* KTLINT

* Legger til innbetaltBeløp og søknadsbarn

* Renamer til barnInfo og gjør flere av feltene nullable

* Fjerner overflødige objekter og deprikerer klage_statistikk

* Legger til hashcode for grunnlagRequestDto
  • Loading branch information
simhos authored Jan 8, 2025
1 parent 943898b commit dd0b7ae
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ data class GrunnlagDto(
override fun toString(): String = super.asString()

override fun hashCode(): Int {
// +grunnlagsreferanseListe.sorted().hashCode()
// + gjelderReferanse.hashCode()
return referanse.hashCode() + type.hashCode() + innholdString.hashCode()
}

Expand All @@ -42,8 +40,6 @@ data class GrunnlagDto(
if (other !is GrunnlagDto) return false
if (referanse != other.referanse) return false
if (type != other.type) return false
// if (gjelderReferanse != other.gjelderReferanse) return false
// if (grunnlagsreferanseListe.sorted() != other.grunnlagsreferanseListe.sorted()) return false
if (innholdString != other.innholdString) return false
return true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package no.nav.bidrag.transport.behandling.vedtak.request

import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.databind.JsonNode
import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.Valid
Expand All @@ -19,7 +20,9 @@ import no.nav.bidrag.domene.organisasjon.Enhetsnummer
import no.nav.bidrag.domene.sak.Saksnummer
import no.nav.bidrag.domene.tid.ÅrMånedsperiode
import no.nav.bidrag.transport.behandling.felles.grunnlag.BaseGrunnlag
import no.nav.bidrag.transport.behandling.felles.grunnlag.GrunnlagDto
import no.nav.bidrag.transport.behandling.felles.grunnlag.Grunnlagsreferanse
import no.nav.bidrag.transport.felles.commonObjectmapper
import java.math.BigDecimal
import java.time.LocalDate
import java.time.LocalDateTime
Expand Down Expand Up @@ -68,6 +71,22 @@ data class OpprettGrunnlagRequestDto(
override val gjelderBarnReferanse: Grunnlagsreferanse? = null,
) : BaseGrunnlag {
override fun toString(): String = super.asString()

override fun hashCode(): Int {
return referanse.hashCode() + type.hashCode() + innholdString.hashCode()
}

@get:JsonIgnore
val innholdString get() = commonObjectmapper.writeValueAsString(innhold)

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is GrunnlagDto) return false
if (referanse != other.referanse) return false
if (type != other.type) return false
if (innholdString != other.innholdString) return false
return true
}
}

@Schema
Expand Down

0 comments on commit dd0b7ae

Please sign in to comment.