Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BO Lokationszuordnung (DEV-80905) #340

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bo/businessobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ func NewBusinessObject(typ botyp.BOTyp) BusinessObject {
bo = new(Lastgang)
bo.(*Lastgang).BoTyp = typ
bo.(*Lastgang).VersionStruktur = defaultVersionStruktur
case botyp.LOKATIONSZUORDNUNG:
bo = new(Lokationszuordnung)
bo.(*Lokationszuordnung).BoTyp = typ
bo.(*Lokationszuordnung).VersionStruktur = defaultVersionStruktur
case botyp.MARKTLOKATION:
bo = new(Marktlokation)
bo.(*Marktlokation).BoTyp = typ
Expand Down
31 changes: 31 additions & 0 deletions bo/lokationszuordnung.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package bo

import "github.com/hochfrequenz/go-bo4e/com"

// The Lokationszuordnung ist ein Modell für die Abbildung der Referenz auf die Lokationsbündelstruktur. Diese gibt an welche Marktlokationen, Messlokationen, Netzlokationen, technische/steuerbaren Ressourcen an einer Lokation vorhanden sind.
type Lokationszuordnung struct {
Geschaeftsobjekt
// Marktlokationen ist eine Liste mit IDs der referenzierten Marktlokationen
Marktlokationen []Marktlokation `json:"marktlokationen,omitempty"`

// Messlokationen ist eine Liste mit IDs der referenzierten Messlokationen
Messlokationen []Messlokation `json:"messlokationen,omitempty"`

// Netzlokationen ist eine Liste mit IDs der referenzierten Netzlokationen
Netzlokationen []Netzlokation `json:"netzlokationen,omitempty"`

// TechnischeRessourcen ist eine Liste mit IDs der referenzierten technischen Ressourcen
TechnischeRessourcen []TechnischeRessource `json:"technischeRessourcen,omitempty"`

// SteuerbareRessourcen ist eine Liste mit IDs der referenzierten steuerbaren Ressourcen
SteuerbareRessourcen []SteuerbareRessource `json:"steuerbareRessourcen,omitempty"`

// Gueltigkeit ist die Zeitspanne in der die Zuordnung gültig ist
Gueltigkeit []com.Zeitraum `json:"gueltigkeit,omitempty"`

// Zuordnungstyp ist die Verknüpfungsrichtung z.B. Malo-Melo
Zuordnungstyp string `json:"zuordnungstyp,omitempty"`

// LokationsbuendelCode ist der Code, der angibt wie die Lokationsbündelstruktur zusammengesetzt ist (zu finden unter "Codeliste der Lokationsbündelstrukturen" auf https://www.edi-energy.de/index.php?id=38)
LokationsbuendelCode string `json:"lokationsbuendelcode,omitempty"`
}
22 changes: 22 additions & 0 deletions bo/lokationszuordnung_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package bo_test

import (
"github.com/corbym/gocrest/is"
"github.com/corbym/gocrest/then"
"github.com/hochfrequenz/go-bo4e/bo"
"github.com/hochfrequenz/go-bo4e/enum/botyp"
"reflect"
"testing"
)

func Test_Empty_Lokationszuordnung_Is_Creatable_Using_BoTyp(t *testing.T) {
object := bo.NewBusinessObject(botyp.LOKATIONSZUORDNUNG)
then.AssertThat(t, object, is.Not(is.EqualTo[bo.BusinessObject](nil)))
then.AssertThat(t, reflect.TypeOf(object), is.EqualTo(reflect.TypeOf(&bo.Lokationszuordnung{})))
then.AssertThat(t, object.GetBoTyp(), is.EqualTo(botyp.LOKATIONSZUORDNUNG))
then.AssertThat(t, object.GetVersionStruktur(), is.EqualTo("1.1"))
}

func Test_Serialized_Empty_Lokationszuordnung_Contains_No_Enum_Defaults(t *testing.T) {
assertDoesNotSerializeDefaultEnums(t, bo.NewBusinessObject(botyp.LOKATIONSZUORDNUNG))
}
63 changes: 32 additions & 31 deletions enum/botyp/botyp.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,38 @@ type BOTyp int

const (
// ANGEBOT is an offer
ANGEBOT BOTyp = iota + 1
ANSPRECHPARTNER // ANSPRECHPARTNER is the type of a contact person, see bo.ANSPRECHPARTNER
AUSSCHREIBUNG // AUSSCHREIBUNG is a tender offer
BILANZIERUNG // BILANZIERUNG contains balancing information (this is not BO4E standard, yet)
ENERGIEMENGE // ENERGIEMENGE is the tpye of an energy amount, see bo.ENERGIEMENGE
GESCHAEFTSPARTNER // GESCHAEFTSPARTNER is a business partner
KOSTEN // KOSTEN are costs
LASTGANG // LASTGANG is the type of bo.LASTGANG
MARKTLOKATION // MARKTLOKATION is a market location / "MaLo"
MESSLOKATION // MESSLOKATION is a metering location / "MeLo"
MARKTTEILNEHMER // MARKTTEILNEHMER is a market partner
NETZNUTZUNGSRECHNUNG // NETZNUTZUNGSRECHNUNG is a grid usage bill
PREISBLATT // PREISBLATT is a price sheet
PREISBLATTDIENSTLEISTUNG // PREISBLATTDIENSTLEISTUNG is a PREISBLATT for services
PREISBLATTKONZESSIONSABGABE // PREISBLATTKONZESSIONSABGABE is a PREISBLATT for concession fees
PREISBLATTMESSUNG // PREISBLATTMESSUNG is a PREISBLATT for metering
PREISBLATTUMLAGEN // PREISBLATTUMLAGEN is a PREISBLATT for allocations
RECHNUNG // RECHNUNG is a Invoice
REKLAMATION // REKLAMATION is the complaint, that an ENERGIEMENGE is missing or unplausible
TARIFINFO // TARIFINFO Are information about tariffs
TARIFPREISBLATT // TARIFPREISBLATT is a PREISBLATT about Tariffs
VERTRAG // VERTRAG is contract
ZAEHLER // ZAEHLER is a power, gas, heat or water meter
ZEITREIHE // ZEITREIHE is data over time (e.g. consumption, prognosis etc.)
HANDELSUNSTIMMIGKEIT // HANDELSUNSTIMMIGKEIT contains information about discrepancies in market communication.
AVIS // AVIS is a REMADV
STATUSBERICHT // Statusbericht states the status of a process and can be used for APERAK or IFTSTA
STEUERBARERESSOURCE // Steuerbare Ressource BO
TECHNISCHERESSOURCE // Technische Ressource BO
TRANCHE // Objekt zur Aufnahme der Informationen zu einer Tranche
ZAEHLZEITDEFINITION // ZAEHLZEITDEFINITION contains collections of Zaehlzeiten, Zaehlzeitregister and ausgerollten Zaehlzeiten
ANGEBOT BOTyp = iota + 1
ANSPRECHPARTNER // ANSPRECHPARTNER is the type of a contact person, see bo.ANSPRECHPARTNER
AUSSCHREIBUNG // AUSSCHREIBUNG is a tender offer
BILANZIERUNG // BILANZIERUNG contains balancing information (this is not BO4E standard, yet)
ENERGIEMENGE // ENERGIEMENGE is the tpye of an energy amount, see bo.ENERGIEMENGE
GESCHAEFTSPARTNER // GESCHAEFTSPARTNER is a business partner
KOSTEN // KOSTEN are costs
LASTGANG // LASTGANG is the type of bo.LASTGANG
LOKATIONSZUORDNUNG
MARKTLOKATION // MARKTLOKATION is a market location / "MaLo"
MESSLOKATION // MESSLOKATION is a metering location / "MeLo"
MARKTTEILNEHMER // MARKTTEILNEHMER is a market partner
NETZNUTZUNGSRECHNUNG // NETZNUTZUNGSRECHNUNG is a grid usage bill
PREISBLATT // PREISBLATT is a price sheet
PREISBLATTDIENSTLEISTUNG // PREISBLATTDIENSTLEISTUNG is a PREISBLATT for services
PREISBLATTKONZESSIONSABGABE // PREISBLATTKONZESSIONSABGABE is a PREISBLATT for concession fees
PREISBLATTMESSUNG // PREISBLATTMESSUNG is a PREISBLATT for metering
PREISBLATTUMLAGEN // PREISBLATTUMLAGEN is a PREISBLATT for allocations
RECHNUNG // RECHNUNG is a Invoice
REKLAMATION // REKLAMATION is the complaint, that an ENERGIEMENGE is missing or unplausible
TARIFINFO // TARIFINFO Are information about tariffs
TARIFPREISBLATT // TARIFPREISBLATT is a PREISBLATT about Tariffs
VERTRAG // VERTRAG is contract
ZAEHLER // ZAEHLER is a power, gas, heat or water meter
ZEITREIHE // ZEITREIHE is data over time (e.g. consumption, prognosis etc.)
HANDELSUNSTIMMIGKEIT // HANDELSUNSTIMMIGKEIT contains information about discrepancies in market communication.
AVIS // AVIS is a REMADV
STATUSBERICHT // Statusbericht states the status of a process and can be used for APERAK or IFTSTA
STEUERBARERESSOURCE // Steuerbare Ressource BO
TECHNISCHERESSOURCE // Technische Ressource BO
TRANCHE // Objekt zur Aufnahme der Informationen zu einer Tranche
ZAEHLZEITDEFINITION // ZAEHLZEITDEFINITION contains collections of Zaehlzeiten, Zaehlzeitregister and ausgerollten Zaehlzeiten
NETZLOKATION
SUMMENZEITREIHE
EINSPEISUNG
Expand Down
3 changes: 3 additions & 0 deletions enum/botyp/botyp_jsonenums.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 29 additions & 28 deletions enum/botyp/botyp_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading