Skip to content

Commit

Permalink
wip slette egenregistrering (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
anderssonw authored Sep 24, 2024
1 parent 7d71797 commit b37070c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ data class Multikilde<T : Any>(val autoritativ: T? = null, val egenregistrert: T
}

data class RegisterMetadata(val registreringstidspunkt: Instant)
data class Bruksareal(val data: Double, val metadata: RegisterMetadata)
data class Byggeaar(val data: Int, val metadata: RegisterMetadata)
data class Vannforsyning(val data: VannforsyningKode, val metadata: RegisterMetadata)
data class Avlop(val data: AvlopKode, val metadata: RegisterMetadata)
data class Bruksareal(val data: Double?, val metadata: RegisterMetadata)
data class Byggeaar(val data: Int?, val metadata: RegisterMetadata)
data class Vannforsyning(val data: VannforsyningKode?, val metadata: RegisterMetadata)
data class Avlop(val data: AvlopKode?, val metadata: RegisterMetadata)
data class Energikilde(val data: EnergikildeKode, val metadata: RegisterMetadata)
data class Oppvarming(val data: OppvarmingKode, val metadata: RegisterMetadata)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fun Bruksenhet.withEgenregistrertData(egenregistreringer: List<Egenregistrering>
},
energikilder = bruksenhetAggregate.energikilder.aggregate {
egenregistrering.second.energikildeRegistrering?.let {
it.energikilder.map { registrertKilde ->
it.energikilder?.map { registrertKilde ->
Energikilde(
data = registrertKilde,
metadata = RegisterMetadata(
Expand All @@ -95,7 +95,7 @@ fun Bruksenhet.withEgenregistrertData(egenregistreringer: List<Egenregistrering>
},
oppvarminger = bruksenhetAggregate.oppvarminger.aggregate {
egenregistrering.second.oppvarmingRegistrering?.let {
it.oppvarminger.map { registrertOppvarming ->
it.oppvarminger?.map { registrertOppvarming ->
Oppvarming(
data = registrertOppvarming,
metadata = RegisterMetadata(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ import java.util.*

@Serializable
data class ByggeaarRegistrering(
val byggeaar: Int,
val byggeaar: Int?,
)

@Serializable
data class BruksarealRegistrering(
val bruksareal: Double,
val bruksareal: Double?,
)

@Serializable
data class VannforsyningRegistrering(
val vannforsyning: VannforsyningKode,
val vannforsyning: VannforsyningKode?,
)

@Serializable
data class AvlopRegistrering(
val avlop: AvlopKode,
val avlop: AvlopKode?,
)

@Serializable
data class EnergikildeRegistrering(
val energikilder: List<EnergikildeKode>,
val energikilder: List<EnergikildeKode>?,
)

@Serializable
data class OppvarmingRegistrering(
val oppvarminger: List<OppvarmingKode>,
val oppvarminger: List<OppvarmingKode>?,
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ data class MultikildeResponse<T : Any>(val autoritativ: T? = null, val egenregis
data class RegisterMetadataResponse(@Serializable(with = InstantSerializer::class) val registreringstidspunkt: Instant)

@Serializable
data class ByggeaarResponse(val data: Int, val metadata: RegisterMetadataResponse)
data class ByggeaarResponse(val data: Int?, val metadata: RegisterMetadataResponse)

@Serializable
data class BruksarealResponse(val data: Double, val metadata: RegisterMetadataResponse)
data class BruksarealResponse(val data: Double?, val metadata: RegisterMetadataResponse)

@Serializable
data class VannforsyningKodeResponse(val data: VannforsyningKode, val metadata: RegisterMetadataResponse)
data class VannforsyningKodeResponse(val data: VannforsyningKode?, val metadata: RegisterMetadataResponse)

@Serializable
data class AvlopKodeResponse(val data: AvlopKode, val metadata: RegisterMetadataResponse)
data class AvlopKodeResponse(val data: AvlopKode?, val metadata: RegisterMetadataResponse)

@Serializable
data class EnergikildeResponse(val data: EnergikildeKode, val metadata: RegisterMetadataResponse)
data class EnergikildeResponse(val data: EnergikildeKode?, val metadata: RegisterMetadataResponse)

@Serializable
data class OppvarmingResponse(val data: OppvarmingKode, val metadata: RegisterMetadataResponse)
data class OppvarmingResponse(val data: OppvarmingKode?, val metadata: RegisterMetadataResponse)

@Serializable
data class BruksenhetResponse(
Expand Down

0 comments on commit b37070c

Please sign in to comment.