Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f2989d9
add typ_com
hf-krechan Mar 20, 2025
a5252c4
rename typ to typ_bo
hf-krechan Mar 20, 2025
42a2c3a
fix imports for typ_bo
hf-krechan Mar 20, 2025
ffbfa5f
Fix import for typbo
hf-krechan Mar 20, 2025
ae88f48
fix import issues
hf-krechan Mar 20, 2025
4288899
rename to botyp
hf-krechan Mar 20, 2025
1a633e7
fix imports
hf-krechan Mar 20, 2025
3ad3d78
rename class to BoTyp
hf-krechan Mar 20, 2025
ae30361
rename to comtyp
hf-krechan Mar 20, 2025
2202822
Merge branch 'main' into add_typ_com_and_typ_bo
hf-krechan Mar 20, 2025
465fe97
add missing coms
hf-krechan Mar 20, 2025
56d698b
add default types for coms
hf-krechan Mar 20, 2025
425147f
add test to check default typ
hf-krechan Mar 20, 2025
7dbcf6d
fix failing tests
hf-krechan Mar 20, 2025
c20d398
Merge branch 'main' into add_typ_com_and_typ_bo
hf-krechan Mar 20, 2025
a7218d2
Fix typehint errors
hf-krechan Mar 20, 2025
73c5cb0
Merge remote-tracking branch 'origin/add_typ_com_and_typ_bo' into add…
hf-krechan Mar 20, 2025
6b4f53b
Merge branch 'main' into add_typ_com_and_typ_bo
hf-krechan Mar 21, 2025
c2054f5
fix regionalepreisstaffel
hf-krechan Mar 21, 2025
93d5c6b
remove Union from RegionalePreisgarantie
hf-krechan Mar 21, 2025
d1312fe
Merge remote-tracking branch 'origin/add_typ_com_and_typ_bo' into add…
hf-krechan Mar 21, 2025
e0ca293
remove union in fremdkostenposition
hf-krechan Mar 21, 2025
234703b
remove unused imports
hf-krechan Mar 21, 2025
85ea0b4
fix kostenposition
hf-krechan Mar 21, 2025
36a7fbe
fix preis and tarifpreis
hf-krechan Mar 21, 2025
65662e5
remove unused imports
hf-krechan Mar 21, 2025
2b13fb8
fix preisgarantie and regionalepreisgarantie
hf-krechan Mar 21, 2025
c97fc24
fix preisstaffel and regionalepreisstaffel
hf-krechan Mar 21, 2025
6e40c52
fix docstring
hf-krechan Mar 21, 2025
e0b6606
Fix docstring in ComTyp
hf-krechan Mar 21, 2025
0162a88
Merge branch 'main' into add_typ_com_and_typ_bo
hf-krechan Mar 21, 2025
26a7992
add hint how to distinguish component and business object
hf-krechan Mar 21, 2025
fca374a
Merge remote-tracking branch 'origin/add_typ_com_and_typ_bo' into add…
hf-krechan Mar 21, 2025
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
2 changes: 1 addition & 1 deletion docs/contributing_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ For data validation and de/serialization we use `pydantic <https://pydantic-docs
Es kommt nur bei meinem Strom-Lieferanten zum Einsatz und beschreibt dort all die tollen Eigenschaften, die mein Verbrauchsverhalten hat.
"""

typ: Annotated[Optional[Typ], Field(alias="_typ")] = Typ.MEINBO
typ: Annotated[Optional[Typ], Field(alias="_typ")] = TypBo.MEINBO

#: Der Lieferbeginn beschreibt den Zeitpunkt ab dem (inklusiv) mich ein Versorger seinen Kunden nennen darf
lieferbeginn: Optional[datetime] = None
Expand Down
6 changes: 4 additions & 2 deletions src/bo4e/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@
"TechnischeRessourceVerbrauchsart",
"Themengebiet",
"Titel",
"Typ",
"BoTyp",
"ComTyp",
"Verbrauchsart",
"Vertragsart",
"Vertragsform",
Expand Down Expand Up @@ -328,6 +329,8 @@
from .enum.befestigungsart import Befestigungsart
from .enum.bemessungsgroesse import Bemessungsgroesse
from .enum.bilanzierungsmethode import Bilanzierungsmethode
from .enum.botyp import BoTyp
from .enum.comtyp import ComTyp
from .enum.dienstleistungstyp import Dienstleistungstyp
from .enum.emobilitaetsart import EMobilitaetsart
from .enum.energierichtung import Energierichtung
Expand Down Expand Up @@ -392,7 +395,6 @@
from .enum.technischeressourceverbrauchsart import TechnischeRessourceVerbrauchsart
from .enum.themengebiet import Themengebiet
from .enum.titel import Titel
from .enum.typ import Typ
from .enum.verbrauchsart import Verbrauchsart
from .enum.vertragsart import Vertragsart
from .enum.vertragsform import Vertragsform
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/angebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pydantic
from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -38,7 +38,7 @@ class Angebot(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.ANGEBOT], Field(alias="_typ")] = Typ.ANGEBOT
typ: Annotated[Literal[BoTyp.ANGEBOT], Field(alias="_typ")] = BoTyp.ANGEBOT
angebotsnummer: Optional[str] = None
"""Eindeutige Nummer des Angebotes"""
angebotsdatum: Optional[pydantic.AwareDatetime] = None
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/ausschreibung.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pydantic
from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand All @@ -36,7 +36,7 @@ class Ausschreibung(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.AUSSCHREIBUNG], Field(alias="_typ")] = Typ.AUSSCHREIBUNG
typ: Annotated[Literal[BoTyp.AUSSCHREIBUNG], Field(alias="_typ")] = BoTyp.AUSSCHREIBUNG
ausschreibungsnummer: Optional[str] = None
"""Vom Herausgeber der Ausschreibung vergebene eindeutige Nummer"""
ausschreibungstyp: Optional["Ausschreibungstyp"] = None
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/bilanzierung.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from bo4e.enum.zeitreihentyp import Zeitreihentyp

from ..enum.abwicklungsmodell import Abwicklungsmodell
from ..enum.typ import Typ
from ..enum.botyp import BoTyp


class Bilanzierung(Geschaeftsobjekt):
Expand All @@ -35,7 +35,7 @@ class Bilanzierung(Geschaeftsobjekt):

"""

typ: Annotated[Optional[Typ], Field(alias="_typ")] = Typ.BILANZIERUNG
typ: Annotated[Optional[BoTyp], Field(alias="_typ")] = BoTyp.BILANZIERUNG

marktlokations_id: Optional[str] = None #: ID der Marktlokation
lastprofil: Optional[list[Lastprofil]] = None #: Eine Liste der verwendeten Lastprofile (SLP, SLP/TLP, ALP etc.)
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/buendelvertrag.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pydantic
from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -38,7 +38,7 @@ class Buendelvertrag(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.BUENDELVERTRAG], Field(alias="_typ")] = Typ.BUENDELVERTRAG
typ: Annotated[Literal[BoTyp.BUENDELVERTRAG], Field(alias="_typ")] = BoTyp.BUENDELVERTRAG

# pylint: disable=duplicate-code
vertragsnummer: Optional[str] = None
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/energiemenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand All @@ -33,7 +33,7 @@ class Energiemenge(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.ENERGIEMENGE], Field(alias="_typ")] = Typ.ENERGIEMENGE
typ: Annotated[Literal[BoTyp.ENERGIEMENGE], Field(alias="_typ")] = BoTyp.ENERGIEMENGE
lokations_id: Optional[str] = None
"""Eindeutige Nummer der Marktlokation bzw. der Messlokation, zu der die Energiemenge gehört"""
lokationstyp: Optional["Lokationstyp"] = None
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/fremdkosten.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -35,7 +35,7 @@ class Fremdkosten(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.FREMDKOSTEN], Field(alias="_typ")] = Typ.FREMDKOSTEN
typ: Annotated[Literal[BoTyp.FREMDKOSTEN], Field(alias="_typ")] = BoTyp.FREMDKOSTEN
gueltigkeit: Optional["Zeitraum"] = None
"""Für diesen Zeitraum wurden die Kosten ermittelt"""
summe_kosten: Optional["Betrag"] = None
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/geraet.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand All @@ -32,7 +32,7 @@ class Geraet(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.GERAET], Field(alias="_typ")] = Typ.GERAET
typ: Annotated[Literal[BoTyp.GERAET], Field(alias="_typ")] = BoTyp.GERAET

geraetenummer: Optional[str] = None
"""Die auf dem Gerät aufgedruckte Nummer, die vom MSB vergeben wird."""
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/geschaeftspartner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -38,7 +38,7 @@ class Geschaeftspartner(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.GESCHAEFTSPARTNER], Field(alias="_typ")] = Typ.GESCHAEFTSPARTNER
typ: Annotated[Literal[BoTyp.GESCHAEFTSPARTNER], Field(alias="_typ")] = BoTyp.GESCHAEFTSPARTNER
anrede: Optional["Anrede"] = None
"""Mögliche Anrede der Person"""
individuelle_anrede: Optional[str] = None
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/kosten.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -36,7 +36,7 @@ class Kosten(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.KOSTEN], Field(alias="_typ")] = Typ.KOSTEN
typ: Annotated[Literal[BoTyp.KOSTEN], Field(alias="_typ")] = BoTyp.KOSTEN
kostenklasse: Optional["Kostenklasse"] = None
"""Klasse der Kosten, beispielsweise Fremdkosten"""
gueltigkeit: Optional["Zeitraum"] = None
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/lastgang.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# pylint: disable=no-name-in-module
from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -39,7 +39,7 @@ class Lastgang(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.LASTGANG], Field(alias="_typ")] = Typ.LASTGANG
typ: Annotated[Literal[BoTyp.LASTGANG], Field(alias="_typ")] = BoTyp.LASTGANG
sparte: Optional["Sparte"] = None
"""Angabe, ob es sich um einen Gas- oder Stromlastgang handelt"""
messgroesse: Optional["Mengeneinheit"] = None
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/lokationszuordnung.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand All @@ -33,7 +33,7 @@ class Lokationszuordnung(Geschaeftsobjekt):
`Lokationszuordnung JSON Schema <https://json-schema.app/view/%23?url=https://raw.githubusercontent.com/BO4E/BO4E-Schemas/{__gh_version__}/src/bo4e_schemas/bo/Lokationszuordnung.json>`_
"""

typ: Annotated[Literal[Typ.LOKATIONSZUORDNUNG], Field(alias="_typ")] = Typ.LOKATIONSZUORDNUNG
typ: Annotated[Literal[BoTyp.LOKATIONSZUORDNUNG], Field(alias="_typ")] = BoTyp.LOKATIONSZUORDNUNG

marktlokationen: Optional[list["Marktlokation"]] = None
"""Liste mit referenzierten Marktlokationen"""
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/marktlokation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -45,7 +45,7 @@ class Marktlokation(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.MARKTLOKATION], Field(alias="_typ")] = Typ.MARKTLOKATION
typ: Annotated[Literal[BoTyp.MARKTLOKATION], Field(alias="_typ")] = BoTyp.MARKTLOKATION

marktlokations_id: Optional[str] = None
"""Identifikationsnummer einer Marktlokation, an der Energie entweder verbraucht, oder erzeugt wird."""
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/marktteilnehmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand All @@ -33,7 +33,7 @@ class Marktteilnehmer(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.MARKTTEILNEHMER], Field(alias="_typ")] = Typ.MARKTTEILNEHMER
typ: Annotated[Literal[BoTyp.MARKTTEILNEHMER], Field(alias="_typ")] = BoTyp.MARKTTEILNEHMER
marktrolle: Optional["Marktrolle"] = None
"""Gibt im Klartext die Bezeichnung der Marktrolle an"""
rollencodenummer: Optional[str] = None
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/messlokation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -38,7 +38,7 @@ class Messlokation(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.MESSLOKATION], Field(alias="_typ")] = Typ.MESSLOKATION
typ: Annotated[Literal[BoTyp.MESSLOKATION], Field(alias="_typ")] = BoTyp.MESSLOKATION

messlokations_id: Optional[str] = None
"""Die Messlokations-Identifikation; Das ist die frühere Zählpunktbezeichnung"""
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/netzlokation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -36,7 +36,7 @@ class Netzlokation(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.NETZLOKATION], Field(alias="_typ")] = Typ.NETZLOKATION
typ: Annotated[Literal[BoTyp.NETZLOKATION], Field(alias="_typ")] = BoTyp.NETZLOKATION

netzlokations_id: Optional[str] = None
"""Identifikationsnummer einer Netzlokation, an der Energie entweder verbraucht, oder erzeugt wird"""
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -36,7 +36,7 @@ class Person(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.PERSON], Field(alias="_typ")] = Typ.PERSON
typ: Annotated[Literal[BoTyp.PERSON], Field(alias="_typ")] = BoTyp.PERSON
anrede: Optional["Anrede"] = None
"""Mögliche Anrede der Person"""
individuelle_anrede: Optional[str] = None
Expand Down
4 changes: 2 additions & 2 deletions src/bo4e/bo/preisblatt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt

Expand Down Expand Up @@ -39,7 +39,7 @@ class Preisblatt(Geschaeftsobjekt):

"""

typ: Annotated[Literal[Typ.PREISBLATT], Field(alias="_typ")] = Typ.PREISBLATT
typ: Annotated[Literal[BoTyp.PREISBLATT], Field(alias="_typ")] = BoTyp.PREISBLATT
bezeichnung: Optional[str] = None
"""Eine Bezeichnung für das Preisblatt"""
sparte: Optional["Sparte"] = None
Expand Down
6 changes: 3 additions & 3 deletions src/bo4e/bo/preisblattdienstleistung.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .preisblatt import Preisblatt

Expand All @@ -33,8 +33,8 @@ class PreisblattDienstleistung(Preisblatt):

"""

typ: Annotated[Literal[Typ.PREISBLATTDIENSTLEISTUNG], Field(alias="_typ")] = (
Typ.PREISBLATTDIENSTLEISTUNG # type: ignore[assignment]
typ: Annotated[Literal[BoTyp.PREISBLATTDIENSTLEISTUNG], Field(alias="_typ")] = (
BoTyp.PREISBLATTDIENSTLEISTUNG # type: ignore[assignment]
)
# required attributes (additional to those of Preisblatt)
bilanzierungsmethode: Optional["Bilanzierungsmethode"] = None
Expand Down
6 changes: 3 additions & 3 deletions src/bo4e/bo/preisblatthardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import Field

from ..enum.typ import Typ
from ..enum.botyp import BoTyp
from ..utils import postprocess_docstring
from .preisblatt import Preisblatt

Expand Down Expand Up @@ -34,8 +34,8 @@ class PreisblattHardware(Preisblatt):

"""

typ: Annotated[Literal[Typ.PREISBLATTHARDWARE], Field(alias="_typ")] = (
Typ.PREISBLATTHARDWARE # type: ignore[assignment]
typ: Annotated[Literal[BoTyp.PREISBLATTHARDWARE], Field(alias="_typ")] = (
BoTyp.PREISBLATTHARDWARE # type: ignore[assignment]
)
# required attributes (additional to those of Preisblatt)
bilanzierungsmethode: Optional["Bilanzierungsmethode"] = None
Expand Down
Loading
Loading