From 189fa05c0ca58ae081f13ef06487ed50ed985308 Mon Sep 17 00:00:00 2001 From: konstantin Date: Thu, 16 Jan 2025 12:30:50 +0100 Subject: [PATCH] fix: change type of `Marktlokation.Katasterinformation` to list (#346) see https://github.com/Hochfrequenz/BO4E-dotnet/pull/616 Co-authored-by: Konstantin --- bo/marktlokation.go | 2 +- bo/marktlokation_test.go | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bo/marktlokation.go b/bo/marktlokation.go index c42071a0..dd7e2455 100644 --- a/bo/marktlokation.go +++ b/bo/marktlokation.go @@ -43,7 +43,7 @@ type Marktlokation struct { // only one of the following three optional address attributes can be set Lokationsadresse *com.Adresse `json:"lokationsadresse,omitempty" validate:"required_without_all=Geoadresse Katasterinformation"` // Lokationsadresse is the address at which the energy supply or feed-in takes place Geoadresse *com.Geokoordinaten `json:"geoadresse,omitempty" validate:"required_without_all=Lokationsadresse Katasterinformation"` // Geoadresse are the gps coordinates - Katasterinformation *com.Katasteradresse `json:"katasterinformation,omitempty" validate:"required_without_all=Lokationsadresse Geoadresse"` // Katasterinformation is the Cadastre address + Katasterinformation []com.Katasteradresse `json:"katasterinformation,omitempty" validate:"required_without_all=Lokationsadresse Geoadresse"` // Katasterinformation is the Cadastre address; It's a list since v0.34.0 because the MaLo Ident model classes are also list like ZugehoerigeMesslokationen []com.Messlokationszuordnung `json:"zugehoerigemesslokationen,omitempty"` // ZugehoerigeMesslokationen is a list of MeLos belonging to this market location Regelzone *string `json:"regelzone,omitempty"` diff --git a/bo/marktlokation_test.go b/bo/marktlokation_test.go index 93d9bd5b..b7560496 100644 --- a/bo/marktlokation_test.go +++ b/bo/marktlokation_test.go @@ -216,12 +216,13 @@ func Test_Failed_MarktlokationValidation(t *testing.T) { Hausnummer: "27A", Landescode: internal.Ptr(landescode.DE), }, - Katasterinformation: &com.Katasteradresse{ - GemarkungFlur: "Foo", - Flurstueck: "Bar", + Katasterinformation: []com.Katasteradresse{ + { + GemarkungFlur: "Foo", + Flurstueck: "Bar", + }, }, - }, - }, + }}, "ne": { bo.Marktlokation{ Geschaeftsobjekt: bo.Geschaeftsobjekt{