Skip to content

Commit

Permalink
Legge til kilde i Sivilstand
Browse files Browse the repository at this point in the history
  • Loading branch information
s148719 committed Nov 17, 2023
1 parent ff645ef commit 2d8d504
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 74 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,71 @@ package no.nav.bidrag.behandling.database.datamodell

import io.swagger.v3.oas.annotations.media.Schema

@Schema(enumAsRef = true)
enum class BoStatusType {
IKKE_REGISTRERT_PA_ADRESSE,
REGISTRERT_PA_ADRESSE,
}

@Schema(enumAsRef = true)
enum class Kilde {
MANUELL,
OFFENTLIG,
}

@Schema(enumAsRef = true)
enum class OpplysningerType {
INNTEKTSOPPLYSNINGER,
BOFORHOLD,
}

// TODO Bruk Sivilstandstype fra bidrag-domain istedenfor
@Schema(enumAsRef = true)
enum class SivilstandType {
BOR_ALENE_MED_BARN,
GIFT,
}

@Schema(enumAsRef = true)
enum class Behandlingstype {
BIDRAG,

FORSKUDD,

BIDRAG18AAR,

EKTEFELLEBIDRAG,

MOTREGNING,

OPPFOSTRINGSBIDRAG,
}


@Schema(enumAsRef = true)
enum class SoknadType {
INDEKSREGULERING,

ALDERSJUSTERING,

OPPHØR,

ALDERSOPPHØR,

REVURDERING,

FASTSETTELSE,

INNKREVING,

KLAGE,

ENDRING,

ENDRING_MOTTAKER,
}


@Schema(enumAsRef = true)
enum class ForskuddAarsakType(val beskrivelse: String) {
SF("Annet"),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class Sivilstand(
val datoTom: Date?,
@Enumerated(EnumType.STRING)
val sivilstandType: SivilstandType,
@Enumerated(EnumType.STRING)
val kilde: Kilde,
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long? = null,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package no.nav.bidrag.behandling.dto.behandling

import com.fasterxml.jackson.annotation.JsonFormat
import io.swagger.v3.oas.annotations.media.Schema
import no.nav.bidrag.behandling.database.datamodell.Kilde
import no.nav.bidrag.behandling.database.datamodell.SivilstandType
import java.time.LocalDate

Expand All @@ -14,4 +15,5 @@ data class SivilstandDto(
@JsonFormat(pattern = "yyyy-MM-dd")
val datoTom: LocalDate?,
val sivilstandType: SivilstandType,
val kilde: Kilde,
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package no.nav.bidrag.behandling.dto.husstandsbarn
import com.fasterxml.jackson.annotation.JsonFormat
import io.swagger.v3.oas.annotations.media.Schema
import no.nav.bidrag.behandling.database.datamodell.BoStatusType
import no.nav.bidrag.behandling.database.datamodell.Kilde
import java.time.LocalDate

data class HusstandsBarnPeriodeDto(
Expand All @@ -16,5 +17,5 @@ data class HusstandsBarnPeriodeDto(
@Schema(required = true)
val boStatus: BoStatusType?,
@Schema(required = true)
val kilde: String,
val kilde: Kilde,
)
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ fun Set<Sivilstand>.toSivilstandDto() =
it.datoFom?.toLocalDate(),
it.datoTom?.toLocalDate(),
it.sivilstandType,
it.kilde,
)
}.toSet()

fun Set<SivilstandDto>.toSivilstandDomain(behandling: Behandling) =
this.map {
Sivilstand(behandling, it.datoFom?.toDate(), it.datoTom?.toDate(), it.sivilstandType, it.id)
Sivilstand(behandling, it.datoFom?.toDate(), it.datoTom?.toDate(), it.sivilstandType,it.kilde, it.id)
}.toMutableSet()

fun Set<Barnetillegg>.toBarnetilleggDto() =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Table: SIVILSTAND

/*
ALTER TABLE SIVILSTAND
DROP COLUMN KILDE;
DELETE FROM FLYWAY_SCHEMA_HISTORY WHERE VERSION = '1.0.32';
*/

ALTER TABLE SIVILSTAND
ADD COLUMN KILDE VARCHAR(25);

0 comments on commit 2d8d504

Please sign in to comment.