-
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 #254 from navikt/feature/tilpasninger-navngiving
Feature/tilpasninger navngiving
- Loading branch information
Showing
68 changed files
with
2,082 additions
and
1,745 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
14 changes: 0 additions & 14 deletions
14
src/main/kotlin/no/nav/bidrag/vedtak/bo/EngangsbelopGrunnlagBo.kt
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/no/nav/bidrag/vedtak/bo/EngangsbeløpGrunnlagBo.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,14 @@ | ||
package no.nav.bidrag.vedtak.bo | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
@Schema | ||
data class EngangsbeløpGrunnlagBo( | ||
|
||
@Schema(description = "Engangsbeløpsid") | ||
val engangsbeløpsid: Int, | ||
|
||
@Schema(description = "Grunnlagsid") | ||
val grunnlagsid: Int | ||
|
||
) |
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
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/no/nav/bidrag/vedtak/bo/StønadsendringGrunnlagBo.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,14 @@ | ||
package no.nav.bidrag.vedtak.bo | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
@Schema | ||
data class StønadsendringGrunnlagBo( | ||
|
||
@Schema(description = "Stønadsendringsid") | ||
val stønadsendringsid: Int, | ||
|
||
@Schema(description = "Grunnlagsid") | ||
val grunnlagsid: Int | ||
|
||
) |
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
82 changes: 0 additions & 82 deletions
82
src/main/kotlin/no/nav/bidrag/vedtak/persistence/entity/Engangsbelop.kt
This file was deleted.
Oops, something went wrong.
87 changes: 87 additions & 0 deletions
87
src/main/kotlin/no/nav/bidrag/vedtak/persistence/entity/Engangsbeløp.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,87 @@ | ||
package no.nav.bidrag.vedtak.persistence.entity | ||
|
||
import jakarta.persistence.Column | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import jakarta.persistence.JoinColumn | ||
import jakarta.persistence.ManyToOne | ||
import no.nav.bidrag.transport.behandling.vedtak.request.OpprettEngangsbeløpRequestDto | ||
import java.math.BigDecimal | ||
import kotlin.reflect.full.memberProperties | ||
|
||
@Entity | ||
data class Engangsbeløp( | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "engangsbeløpsid") | ||
val id: Int = 0, | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "vedtaksid") | ||
val vedtak: Vedtak = Vedtak(), | ||
|
||
@Column(nullable = false, name = "type") | ||
val type: String = "", | ||
|
||
@Column(nullable = false, name = "sak") | ||
val sak: String = "", | ||
|
||
@Column(nullable = false, name = "skyldner") | ||
val skyldner: String = "", | ||
|
||
@Column(nullable = false, name = "kravhaver") | ||
val kravhaver: String = "", | ||
|
||
@Column(nullable = false, name = "mottaker") | ||
val mottaker: String = "", | ||
|
||
@Column(nullable = true, name = "beløp") | ||
val beløp: BigDecimal? = BigDecimal.ZERO, | ||
|
||
@Column(nullable = true, name = "valutakode") | ||
val valutakode: String? = "", | ||
|
||
@Column(nullable = false, name = "resultatkode") | ||
val resultatkode: String = "", | ||
|
||
@Column(nullable = false, name = "innkreving") | ||
val innkreving: String = "", | ||
|
||
@Column(nullable = false, name = "beslutning") | ||
val beslutning: String = "", | ||
|
||
@Column(nullable = true, name = "omgjør_vedtak_id") | ||
val omgjørVedtakId: Int? = 0, | ||
|
||
@Column(nullable = false, name = "referanse") | ||
val referanse: String = "", | ||
|
||
@Column(nullable = true, name = "delytelse_id") | ||
val delytelseId: String? = "", | ||
|
||
@Column(nullable = true, name = "ekstern_referanse") | ||
val eksternReferanse: String? = "" | ||
) | ||
|
||
fun OpprettEngangsbeløpRequestDto.toEngangsbeløpEntity(eksisterendeVedtak: Vedtak) = with(::Engangsbeløp) { | ||
val propertiesByName = OpprettEngangsbeløpRequestDto::class.memberProperties.associateBy { it.name } | ||
callBy( | ||
parameters.associateWith { parameter -> | ||
when (parameter.name) { | ||
Engangsbeløp::id.name -> 0 | ||
Engangsbeløp::vedtak.name -> eksisterendeVedtak | ||
Engangsbeløp::type.name -> type.toString() | ||
Engangsbeløp::sak.name -> sak.toString() | ||
Stønadsendring::skyldner.name -> skyldner.verdi | ||
Stønadsendring::kravhaver.name -> kravhaver.verdi | ||
Stønadsendring::mottaker.name -> mottaker.verdi | ||
Engangsbeløp::innkreving.name -> innkreving.toString() | ||
Stønadsendring::beslutning.name -> beslutning.toString() | ||
else -> propertiesByName[parameter.name]?.get(this@toEngangsbeløpEntity) | ||
} | ||
} | ||
) | ||
} |
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.