From f2989d99d64d7e87be17161163780d9f1d99d1ec Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 12:33:47 +0100 Subject: [PATCH 01/26] add typ_com --- src/bo4e/enum/typ_com.py | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/bo4e/enum/typ_com.py diff --git a/src/bo4e/enum/typ_com.py b/src/bo4e/enum/typ_com.py new file mode 100644 index 000000000..5d8f21cac --- /dev/null +++ b/src/bo4e/enum/typ_com.py @@ -0,0 +1,68 @@ +# pylint:disable=missing-module-docstring +from bo4e.enum.strenum import StrEnum + + +class TypCom(StrEnum): + """ + Auflistung sämtlicher existierender Geschäftsobjekte. + """ + + ADRESSE = "ADRESSE" + ANGEBOTSPOSITION = "ANGEBOTSPOSITION" + ANGEBOTSTEIL = "ANGEBOTSTEIL" + ANGEBOTSVARIANTE = "ANGEBOTSVARIANTE" + AUFABSCHLAG = "AUFABSCHLAG" + AUFABSCHLAGPROORT = "AUFABSCHLAGPROORT" + AUFABSCHLAGREGIONAL = "AUFABSCHLAGREGIONAL" + AUFABSCHLAGSTAFFELPROORT = "AUFABSCHLAGSTAFFELPROORT" + AUSSCHREIBUNGSDETAIL = "AUSSCHREIBUNGSDETAIL" + + AUSSCHREIBUNGSLOS = "AUSSCHREIBUNGSLOS" + BETRAG = "BETRAG" + DIENSTLEISTUNG = "DIENSTLEISTUNG" + ENERGIEHERKUNFT = "ENERGIEHERKUNFT" + ENERGIEMIX = "ENERGIEMIX" + FREMDKOSTENBLOCK = "FREMDKOSTENBLOCK" + FREMDKOSTENPOSITION = "FREMDKOSTENPOSITION" + GEOKOORDINATEN = "GEOKOORDINATEN" + KATASTERADRESSE = "KATASTERADRESSE" + KONFIGURATIONSPRODUKT = "KONFIGURATIONSPRODUKT" + KONTAKTWEG = "KONTAKTWEG" + KONZESSIONSABGABE = "KONZESSIONSABGABE" + KOSTENBLOCK = "KOSTENBLOCK" + KOSTENPOSITION = "KOSTENPOSITION" + KRITERIUMWERT = "KRITERIUMWERT" + MARKTGEBIETINFO = "MARKTGEBIETINFO" + MENGE = "MENGE" + POSITIONSAUFABSCHLAG = "POSITIONSAUFABSCHLAG" + PREIS = "PREIS" + PREISGARANTIE = "PREISGARANTIE" + PREISPOSITION = "PREISPOSITION" + PREISSTAFFEL = "PREISSTAFFEL" + RECHNUNGSPOSITION = "RECHNUNGSPOSITION" + REGIONALEGUELTIGKEIT = "REGIONALEGUELTIGKEIT" + REGIONALERPREISGARANTIE = "REGIONALERPREISGARANTIE" + REGIONALERPREISSTAFFEL = "REGIONALERPREISSTAFFEL" + REGIONALERAUFABSCHLAG = "REGIONALERAUFABSCHLAG" + REGIONALERTARIFPREISPOSITION = "REGIONALERTARIFPREISPOSITION" + REGIONSKRITERIUM = "REGIONSKRITERIUM" + SIGMOIDPARAMETER = "SIGMOIDPARAMETER" + STANDORTEIGENSCHAFTENGAS = "STANDORTEIGENSCHAFTENGAS" + STANDORTEIGENSCHAFTENSTROM = "STANDORTEIGENSCHAFTENSTROM" + STEUERBETRAG = "STEUERBETRAG" + TARIFBERECHNUNGSPARAMETER = "TARIFBERECHNUNGSPARAMETER" + TARIFEINSCHRAENKUNG = "TARIFEINSCHRAENKUNG" + TARIFPREIS = "TARIFPREIS" + TARIFPREISPOSITION = "TARIFPREISPOSITION" + TARIFPREISPOSITIONPROORT = "TARIFPREISPOSITIONPROORT" + TARIFPREISSTAFFELPROORT = "TARIFPREISSTAFFELPROORT" + UNTERSCHRIFT = "UNTERSCHRIFT" + VERBRAUCH = "VERBRAUCH" + VERTRAGSKONDITIONEN = "VERTRAGSKONDITIONEN" + VERTRAGSTEIL = "VERTRAGSTEIL" + VERWENDUNGSZWECKPROMARKTROLLE = "VERWENDUNGSZWECKPROMARKTROLLE" + ZAEHLWERK = "ZAEHLWERK" + ZAEHLZEITREGISTER = "ZAEHLZEITREGISTER" + ZEITRAUM = "ZEITRAUM" + ZEITREIHEWERT = "ZEITREIHEWERT" + ZUSTAENDIGKEIT = "ZUSTAENDIGKEIT" From a5252c4b149c41466a118d80760827236a634d2e Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 12:34:01 +0100 Subject: [PATCH 02/26] rename typ to typ_bo --- src/bo4e/enum/{typ.py => typ_bo.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/bo4e/enum/{typ.py => typ_bo.py} (98%) diff --git a/src/bo4e/enum/typ.py b/src/bo4e/enum/typ_bo.py similarity index 98% rename from src/bo4e/enum/typ.py rename to src/bo4e/enum/typ_bo.py index d3dcdaf46..2aea01491 100644 --- a/src/bo4e/enum/typ.py +++ b/src/bo4e/enum/typ_bo.py @@ -2,7 +2,7 @@ from bo4e.enum.strenum import StrEnum -class Typ(StrEnum): +class TypBo(StrEnum): """ Auflistung sämtlicher existierender Geschäftsobjekte. """ From 42a2c3a686c28aceee0437f4090194537819633e Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 12:34:35 +0100 Subject: [PATCH 03/26] fix imports for typ_bo --- src/bo4e/__init__.py | 2 +- src/bo4e/bo/angebot.py | 2 +- src/bo4e/bo/ausschreibung.py | 2 +- src/bo4e/bo/buendelvertrag.py | 2 +- src/bo4e/bo/energiemenge.py | 2 +- src/bo4e/bo/fremdkosten.py | 2 +- src/bo4e/bo/geraet.py | 2 +- src/bo4e/bo/geschaeftspartner.py | 2 +- src/bo4e/bo/kosten.py | 2 +- src/bo4e/bo/lastgang.py | 2 +- src/bo4e/bo/lokationszuordnung.py | 2 +- src/bo4e/bo/marktlokation.py | 2 +- src/bo4e/bo/marktteilnehmer.py | 2 +- src/bo4e/bo/messlokation.py | 2 +- src/bo4e/bo/netzlokation.py | 2 +- src/bo4e/bo/person.py | 2 +- src/bo4e/bo/preisblatt.py | 2 +- src/bo4e/bo/preisblattdienstleistung.py | 2 +- src/bo4e/bo/preisblatthardware.py | 2 +- src/bo4e/bo/preisblattkonzessionsabgabe.py | 2 +- src/bo4e/bo/preisblattmessung.py | 2 +- src/bo4e/bo/preisblattnetznutzung.py | 2 +- src/bo4e/bo/rechnung.py | 2 +- src/bo4e/bo/region.py | 2 +- src/bo4e/bo/regionaltarif.py | 2 +- src/bo4e/bo/standorteigenschaften.py | 2 +- src/bo4e/bo/steuerbareressource.py | 2 +- src/bo4e/bo/tarif.py | 2 +- src/bo4e/bo/tarifinfo.py | 2 +- src/bo4e/bo/tarifkosten.py | 2 +- src/bo4e/bo/tarifpreisblatt.py | 2 +- src/bo4e/bo/technischeressource.py | 2 +- src/bo4e/bo/vertrag.py | 2 +- src/bo4e/bo/zaehler.py | 2 +- src/bo4e/bo/zeitreihe.py | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/bo4e/__init__.py b/src/bo4e/__init__.py index c45aebf00..3a19c80f0 100644 --- a/src/bo4e/__init__.py +++ b/src/bo4e/__init__.py @@ -370,7 +370,7 @@ from .enum.technischeressourceverbrauchsart import TechnischeRessourceVerbrauchsart from .enum.themengebiet import Themengebiet from .enum.titel import Titel -from .enum.typ import Typ +from .enum.typ_bo import Typ from .enum.verbrauchsart import Verbrauchsart from .enum.vertragsart import Vertragsart from .enum.vertragsform import Vertragsform diff --git a/src/bo4e/bo/angebot.py b/src/bo4e/bo/angebot.py index 8de11abc6..9401d6409 100644 --- a/src/bo4e/bo/angebot.py +++ b/src/bo4e/bo/angebot.py @@ -9,7 +9,7 @@ import pydantic from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/ausschreibung.py b/src/bo4e/bo/ausschreibung.py index e4d3b043e..77635fb58 100644 --- a/src/bo4e/bo/ausschreibung.py +++ b/src/bo4e/bo/ausschreibung.py @@ -9,7 +9,7 @@ import pydantic from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/buendelvertrag.py b/src/bo4e/bo/buendelvertrag.py index 96767ab57..96467a871 100644 --- a/src/bo4e/bo/buendelvertrag.py +++ b/src/bo4e/bo/buendelvertrag.py @@ -9,7 +9,7 @@ import pydantic from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/energiemenge.py b/src/bo4e/bo/energiemenge.py index ed1043ea1..a13f0f742 100644 --- a/src/bo4e/bo/energiemenge.py +++ b/src/bo4e/bo/energiemenge.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/fremdkosten.py b/src/bo4e/bo/fremdkosten.py index 5c94223c8..fd97f4b30 100644 --- a/src/bo4e/bo/fremdkosten.py +++ b/src/bo4e/bo/fremdkosten.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/geraet.py b/src/bo4e/bo/geraet.py index a0c50f3b6..fad8beeed 100644 --- a/src/bo4e/bo/geraet.py +++ b/src/bo4e/bo/geraet.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/geschaeftspartner.py b/src/bo4e/bo/geschaeftspartner.py index 034c13abc..2d951090b 100644 --- a/src/bo4e/bo/geschaeftspartner.py +++ b/src/bo4e/bo/geschaeftspartner.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/kosten.py b/src/bo4e/bo/kosten.py index 4fd2a6ea3..ec36d217a 100644 --- a/src/bo4e/bo/kosten.py +++ b/src/bo4e/bo/kosten.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/lastgang.py b/src/bo4e/bo/lastgang.py index 083ca1bf5..f1a33845c 100644 --- a/src/bo4e/bo/lastgang.py +++ b/src/bo4e/bo/lastgang.py @@ -9,7 +9,7 @@ # pylint: disable=no-name-in-module from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/lokationszuordnung.py b/src/bo4e/bo/lokationszuordnung.py index 7ee433b57..881512990 100644 --- a/src/bo4e/bo/lokationszuordnung.py +++ b/src/bo4e/bo/lokationszuordnung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/marktlokation.py b/src/bo4e/bo/marktlokation.py index 01b896160..a1e43e179 100644 --- a/src/bo4e/bo/marktlokation.py +++ b/src/bo4e/bo/marktlokation.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/marktteilnehmer.py b/src/bo4e/bo/marktteilnehmer.py index b207d0a3f..3d9f8ad54 100644 --- a/src/bo4e/bo/marktteilnehmer.py +++ b/src/bo4e/bo/marktteilnehmer.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/messlokation.py b/src/bo4e/bo/messlokation.py index 0c447501f..32a4afe08 100644 --- a/src/bo4e/bo/messlokation.py +++ b/src/bo4e/bo/messlokation.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/netzlokation.py b/src/bo4e/bo/netzlokation.py index 3411247d5..afeb1ea26 100644 --- a/src/bo4e/bo/netzlokation.py +++ b/src/bo4e/bo/netzlokation.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/person.py b/src/bo4e/bo/person.py index 7bb077a97..c1602931c 100644 --- a/src/bo4e/bo/person.py +++ b/src/bo4e/bo/person.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/preisblatt.py b/src/bo4e/bo/preisblatt.py index 8927ff322..46b009769 100644 --- a/src/bo4e/bo/preisblatt.py +++ b/src/bo4e/bo/preisblatt.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/preisblattdienstleistung.py b/src/bo4e/bo/preisblattdienstleistung.py index b13b8971f..6b6d72395 100644 --- a/src/bo4e/bo/preisblattdienstleistung.py +++ b/src/bo4e/bo/preisblattdienstleistung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .preisblatt import Preisblatt diff --git a/src/bo4e/bo/preisblatthardware.py b/src/bo4e/bo/preisblatthardware.py index f7f7361c1..5d83bab82 100644 --- a/src/bo4e/bo/preisblatthardware.py +++ b/src/bo4e/bo/preisblatthardware.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .preisblatt import Preisblatt diff --git a/src/bo4e/bo/preisblattkonzessionsabgabe.py b/src/bo4e/bo/preisblattkonzessionsabgabe.py index 63b5975b6..fa8739cb3 100644 --- a/src/bo4e/bo/preisblattkonzessionsabgabe.py +++ b/src/bo4e/bo/preisblattkonzessionsabgabe.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .preisblatt import Preisblatt diff --git a/src/bo4e/bo/preisblattmessung.py b/src/bo4e/bo/preisblattmessung.py index 426cead9c..5b6fe6bbf 100644 --- a/src/bo4e/bo/preisblattmessung.py +++ b/src/bo4e/bo/preisblattmessung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .preisblatt import Preisblatt diff --git a/src/bo4e/bo/preisblattnetznutzung.py b/src/bo4e/bo/preisblattnetznutzung.py index 52ef2f58f..e65091b7a 100644 --- a/src/bo4e/bo/preisblattnetznutzung.py +++ b/src/bo4e/bo/preisblattnetznutzung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .preisblatt import Preisblatt diff --git a/src/bo4e/bo/rechnung.py b/src/bo4e/bo/rechnung.py index 6d5502d1d..df51d6d4f 100644 --- a/src/bo4e/bo/rechnung.py +++ b/src/bo4e/bo/rechnung.py @@ -8,7 +8,7 @@ import pydantic from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/region.py b/src/bo4e/bo/region.py index b757f8cd3..a06a91207 100644 --- a/src/bo4e/bo/region.py +++ b/src/bo4e/bo/region.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/regionaltarif.py b/src/bo4e/bo/regionaltarif.py index 5deb10346..08f5f13f0 100644 --- a/src/bo4e/bo/regionaltarif.py +++ b/src/bo4e/bo/regionaltarif.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from .tarifinfo import Tarifinfo if TYPE_CHECKING: diff --git a/src/bo4e/bo/standorteigenschaften.py b/src/bo4e/bo/standorteigenschaften.py index 31835f7c6..3bab9a0fc 100644 --- a/src/bo4e/bo/standorteigenschaften.py +++ b/src/bo4e/bo/standorteigenschaften.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/steuerbareressource.py b/src/bo4e/bo/steuerbareressource.py index a42ba4c15..4a9dfdb2e 100644 --- a/src/bo4e/bo/steuerbareressource.py +++ b/src/bo4e/bo/steuerbareressource.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/tarif.py b/src/bo4e/bo/tarif.py index f1c6746c7..3bc2fc1c2 100644 --- a/src/bo4e/bo/tarif.py +++ b/src/bo4e/bo/tarif.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo diff --git a/src/bo4e/bo/tarifinfo.py b/src/bo4e/bo/tarifinfo.py index aa01724e4..ad07a3f7e 100644 --- a/src/bo4e/bo/tarifinfo.py +++ b/src/bo4e/bo/tarifinfo.py @@ -10,7 +10,7 @@ import pydantic from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/tarifkosten.py b/src/bo4e/bo/tarifkosten.py index 0d8b3b80a..fd851951b 100644 --- a/src/bo4e/bo/tarifkosten.py +++ b/src/bo4e/bo/tarifkosten.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo diff --git a/src/bo4e/bo/tarifpreisblatt.py b/src/bo4e/bo/tarifpreisblatt.py index 46198194b..c24615c70 100644 --- a/src/bo4e/bo/tarifpreisblatt.py +++ b/src/bo4e/bo/tarifpreisblatt.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo diff --git a/src/bo4e/bo/technischeressource.py b/src/bo4e/bo/technischeressource.py index 59618b983..48cfe838d 100644 --- a/src/bo4e/bo/technischeressource.py +++ b/src/bo4e/bo/technischeressource.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/vertrag.py b/src/bo4e/bo/vertrag.py index a48dde0af..b34ffb561 100644 --- a/src/bo4e/bo/vertrag.py +++ b/src/bo4e/bo/vertrag.py @@ -8,7 +8,7 @@ import pydantic from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/zaehler.py b/src/bo4e/bo/zaehler.py index 188c8e294..d261d60c6 100644 --- a/src/bo4e/bo/zaehler.py +++ b/src/bo4e/bo/zaehler.py @@ -12,7 +12,7 @@ import pydantic from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/zeitreihe.py b/src/bo4e/bo/zeitreihe.py index 4793bb5f1..1c2f85d0e 100644 --- a/src/bo4e/bo/zeitreihe.py +++ b/src/bo4e/bo/zeitreihe.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ import Typ +from ..enum.typ_bo import Typ from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt From ffbfa5f19b5fffc77680e6c216c101e2bfa18b66 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 12:39:59 +0100 Subject: [PATCH 04/26] Fix import for typbo --- docs/contributing_guide.rst | 2 +- src/bo4e/__init__.py | 2 +- src/bo4e/bo/angebot.py | 4 ++-- src/bo4e/bo/ausschreibung.py | 4 ++-- src/bo4e/bo/buendelvertrag.py | 4 ++-- src/bo4e/bo/energiemenge.py | 4 ++-- src/bo4e/bo/fremdkosten.py | 4 ++-- src/bo4e/bo/geraet.py | 4 ++-- src/bo4e/bo/geschaeftspartner.py | 4 ++-- src/bo4e/bo/kosten.py | 4 ++-- src/bo4e/bo/lastgang.py | 4 ++-- src/bo4e/bo/lokationszuordnung.py | 4 ++-- src/bo4e/bo/marktlokation.py | 4 ++-- src/bo4e/bo/marktteilnehmer.py | 4 ++-- src/bo4e/bo/messlokation.py | 4 ++-- src/bo4e/bo/netzlokation.py | 4 ++-- src/bo4e/bo/person.py | 4 ++-- src/bo4e/bo/preisblatt.py | 4 ++-- src/bo4e/bo/preisblattdienstleistung.py | 6 +++--- src/bo4e/bo/preisblatthardware.py | 6 +++--- src/bo4e/bo/preisblattkonzessionsabgabe.py | 6 +++--- src/bo4e/bo/preisblattmessung.py | 6 +++--- src/bo4e/bo/preisblattnetznutzung.py | 6 +++--- src/bo4e/bo/rechnung.py | 4 ++-- src/bo4e/bo/region.py | 4 ++-- src/bo4e/bo/regionaltarif.py | 4 ++-- src/bo4e/bo/standorteigenschaften.py | 4 ++-- src/bo4e/bo/steuerbareressource.py | 4 ++-- src/bo4e/bo/tarif.py | 4 ++-- src/bo4e/bo/tarifinfo.py | 4 ++-- src/bo4e/bo/tarifkosten.py | 4 ++-- src/bo4e/bo/tarifpreisblatt.py | 4 ++-- src/bo4e/bo/technischeressource.py | 4 ++-- src/bo4e/bo/vertrag.py | 4 ++-- src/bo4e/bo/zaehler.py | 4 ++-- src/bo4e/bo/zeitreihe.py | 4 ++-- 36 files changed, 75 insertions(+), 75 deletions(-) diff --git a/docs/contributing_guide.rst b/docs/contributing_guide.rst index fb774b8ba..624391ce3 100644 --- a/docs/contributing_guide.rst +++ b/docs/contributing_guide.rst @@ -83,7 +83,7 @@ For data validation and de/serialization we use `pydantic `_ """ - typ: Annotated[Literal[Typ.LOKATIONSZUORDNUNG], Field(alias="_typ")] = Typ.LOKATIONSZUORDNUNG + typ: Annotated[Literal[TypBo.LOKATIONSZUORDNUNG], Field(alias="_typ")] = TypBo.LOKATIONSZUORDNUNG marktlokationen: Optional[list["Marktlokation"]] = None """Liste mit referenzierten Marktlokationen""" diff --git a/src/bo4e/bo/marktlokation.py b/src/bo4e/bo/marktlokation.py index a1e43e179..2d6163bfe 100644 --- a/src/bo4e/bo/marktlokation.py +++ b/src/bo4e/bo/marktlokation.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -46,7 +46,7 @@ class Marktlokation(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.MARKTLOKATION], Field(alias="_typ")] = Typ.MARKTLOKATION + typ: Annotated[Literal[TypBo.MARKTLOKATION], Field(alias="_typ")] = TypBo.MARKTLOKATION marktlokations_id: Optional[str] = None """Identifikationsnummer einer Marktlokation, an der Energie entweder verbraucht, oder erzeugt wird.""" diff --git a/src/bo4e/bo/marktteilnehmer.py b/src/bo4e/bo/marktteilnehmer.py index 3d9f8ad54..696f91002 100644 --- a/src/bo4e/bo/marktteilnehmer.py +++ b/src/bo4e/bo/marktteilnehmer.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -34,7 +34,7 @@ class Marktteilnehmer(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.MARKTTEILNEHMER], Field(alias="_typ")] = Typ.MARKTTEILNEHMER + typ: Annotated[Literal[TypBo.MARKTTEILNEHMER], Field(alias="_typ")] = TypBo.MARKTTEILNEHMER marktrolle: Optional["Marktrolle"] = None """Gibt im Klartext die Bezeichnung der Marktrolle an""" rollencodenummer: Optional[str] = None diff --git a/src/bo4e/bo/messlokation.py b/src/bo4e/bo/messlokation.py index 32a4afe08..36e256522 100644 --- a/src/bo4e/bo/messlokation.py +++ b/src/bo4e/bo/messlokation.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -39,7 +39,7 @@ class Messlokation(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.MESSLOKATION], Field(alias="_typ")] = Typ.MESSLOKATION + typ: Annotated[Literal[TypBo.MESSLOKATION], Field(alias="_typ")] = TypBo.MESSLOKATION messlokations_id: Optional[str] = None """Die Messlokations-Identifikation; Das ist die frühere Zählpunktbezeichnung""" diff --git a/src/bo4e/bo/netzlokation.py b/src/bo4e/bo/netzlokation.py index afeb1ea26..963e53318 100644 --- a/src/bo4e/bo/netzlokation.py +++ b/src/bo4e/bo/netzlokation.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -37,7 +37,7 @@ class Netzlokation(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.NETZLOKATION], Field(alias="_typ")] = Typ.NETZLOKATION + typ: Annotated[Literal[TypBo.NETZLOKATION], Field(alias="_typ")] = TypBo.NETZLOKATION netzlokations_id: Optional[str] = None """Identifikationsnummer einer Netzlokation, an der Energie entweder verbraucht, oder erzeugt wird""" diff --git a/src/bo4e/bo/person.py b/src/bo4e/bo/person.py index c1602931c..99fe0d14d 100644 --- a/src/bo4e/bo/person.py +++ b/src/bo4e/bo/person.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -37,7 +37,7 @@ class Person(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.PERSON], Field(alias="_typ")] = Typ.PERSON + typ: Annotated[Literal[TypBo.PERSON], Field(alias="_typ")] = TypBo.PERSON anrede: Optional["Anrede"] = None """Mögliche Anrede der Person""" individuelle_anrede: Optional[str] = None diff --git a/src/bo4e/bo/preisblatt.py b/src/bo4e/bo/preisblatt.py index 46b009769..00655b6ee 100644 --- a/src/bo4e/bo/preisblatt.py +++ b/src/bo4e/bo/preisblatt.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -40,7 +40,7 @@ class Preisblatt(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.PREISBLATT], Field(alias="_typ")] = Typ.PREISBLATT + typ: Annotated[Literal[TypBo.PREISBLATT], Field(alias="_typ")] = TypBo.PREISBLATT bezeichnung: Optional[str] = None """Eine Bezeichnung für das Preisblatt""" sparte: Optional["Sparte"] = None diff --git a/src/bo4e/bo/preisblattdienstleistung.py b/src/bo4e/bo/preisblattdienstleistung.py index 6b6d72395..0f79fb733 100644 --- a/src/bo4e/bo/preisblattdienstleistung.py +++ b/src/bo4e/bo/preisblattdienstleistung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .preisblatt import Preisblatt @@ -33,8 +33,8 @@ class PreisblattDienstleistung(Preisblatt): """ - typ: Annotated[Literal[Typ.PREISBLATTDIENSTLEISTUNG], Field(alias="_typ")] = ( - Typ.PREISBLATTDIENSTLEISTUNG # type: ignore[assignment] + typ: Annotated[Literal[TypBo.PREISBLATTDIENSTLEISTUNG], Field(alias="_typ")] = ( + TypBo.PREISBLATTDIENSTLEISTUNG # type: ignore[assignment] ) # required attributes (additional to those of Preisblatt) bilanzierungsmethode: Optional["Bilanzierungsmethode"] = None diff --git a/src/bo4e/bo/preisblatthardware.py b/src/bo4e/bo/preisblatthardware.py index 5d83bab82..7553f1abf 100644 --- a/src/bo4e/bo/preisblatthardware.py +++ b/src/bo4e/bo/preisblatthardware.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .preisblatt import Preisblatt @@ -34,8 +34,8 @@ class PreisblattHardware(Preisblatt): """ - typ: Annotated[Literal[Typ.PREISBLATTHARDWARE], Field(alias="_typ")] = ( - Typ.PREISBLATTHARDWARE # type: ignore[assignment] + typ: Annotated[Literal[TypBo.PREISBLATTHARDWARE], Field(alias="_typ")] = ( + TypBo.PREISBLATTHARDWARE # type: ignore[assignment] ) # required attributes (additional to those of Preisblatt) bilanzierungsmethode: Optional["Bilanzierungsmethode"] = None diff --git a/src/bo4e/bo/preisblattkonzessionsabgabe.py b/src/bo4e/bo/preisblattkonzessionsabgabe.py index fa8739cb3..21ae61c97 100644 --- a/src/bo4e/bo/preisblattkonzessionsabgabe.py +++ b/src/bo4e/bo/preisblattkonzessionsabgabe.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .preisblatt import Preisblatt @@ -31,8 +31,8 @@ class PreisblattKonzessionsabgabe(Preisblatt): """ - typ: Annotated[Literal[Typ.PREISBLATTKONZESSIONSABGABE], Field(alias="_typ")] = ( - Typ.PREISBLATTKONZESSIONSABGABE # type: ignore[assignment] + typ: Annotated[Literal[TypBo.PREISBLATTKONZESSIONSABGABE], Field(alias="_typ")] = ( + TypBo.PREISBLATTKONZESSIONSABGABE # type: ignore[assignment] ) # required attributes (additional to those of Preisblatt) kundengruppe_k_a: Optional["KundengruppeKA"] = None diff --git a/src/bo4e/bo/preisblattmessung.py b/src/bo4e/bo/preisblattmessung.py index 5b6fe6bbf..36ab012fb 100644 --- a/src/bo4e/bo/preisblattmessung.py +++ b/src/bo4e/bo/preisblattmessung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .preisblatt import Preisblatt @@ -35,8 +35,8 @@ class PreisblattMessung(Preisblatt): """ - typ: Annotated[Literal[Typ.PREISBLATTMESSUNG], Field(alias="_typ")] = ( - Typ.PREISBLATTMESSUNG # type: ignore[assignment] + typ: Annotated[Literal[TypBo.PREISBLATTMESSUNG], Field(alias="_typ")] = ( + TypBo.PREISBLATTMESSUNG # type: ignore[assignment] ) # required attributes (additional to those of Preisblatt) bilanzierungsmethode: Optional["Bilanzierungsmethode"] = None diff --git a/src/bo4e/bo/preisblattnetznutzung.py b/src/bo4e/bo/preisblattnetznutzung.py index e65091b7a..076efa392 100644 --- a/src/bo4e/bo/preisblattnetznutzung.py +++ b/src/bo4e/bo/preisblattnetznutzung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .preisblatt import Preisblatt @@ -33,8 +33,8 @@ class PreisblattNetznutzung(Preisblatt): """ - typ: Annotated[Literal[Typ.PREISBLATTNETZNUTZUNG], Field(alias="_typ")] = ( - Typ.PREISBLATTNETZNUTZUNG # type: ignore[assignment] + typ: Annotated[Literal[TypBo.PREISBLATTNETZNUTZUNG], Field(alias="_typ")] = ( + TypBo.PREISBLATTNETZNUTZUNG # type: ignore[assignment] ) # required attributes (additional to those of Preisblatt) bilanzierungsmethode: Optional["Bilanzierungsmethode"] = None diff --git a/src/bo4e/bo/rechnung.py b/src/bo4e/bo/rechnung.py index df51d6d4f..ad808bad1 100644 --- a/src/bo4e/bo/rechnung.py +++ b/src/bo4e/bo/rechnung.py @@ -8,7 +8,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -43,7 +43,7 @@ class Rechnung(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.RECHNUNG], Field(alias="_typ")] = Typ.RECHNUNG + typ: Annotated[Literal[TypBo.RECHNUNG], Field(alias="_typ")] = TypBo.RECHNUNG ist_storno: Optional[bool] = None """ Kennzeichnung, ob es sich um eine Stornorechnung handelt; diff --git a/src/bo4e/bo/region.py b/src/bo4e/bo/region.py index a06a91207..87ce9baa3 100644 --- a/src/bo4e/bo/region.py +++ b/src/bo4e/bo/region.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -32,7 +32,7 @@ class Region(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.REGION], Field(alias="_typ")] = Typ.REGION + typ: Annotated[Literal[TypBo.REGION], Field(alias="_typ")] = TypBo.REGION bezeichnung: Optional[str] = None """Bezeichnung der Region""" diff --git a/src/bo4e/bo/regionaltarif.py b/src/bo4e/bo/regionaltarif.py index 08f5f13f0..145e3aacc 100644 --- a/src/bo4e/bo/regionaltarif.py +++ b/src/bo4e/bo/regionaltarif.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from .tarifinfo import Tarifinfo if TYPE_CHECKING: @@ -35,7 +35,7 @@ class Regionaltarif(Tarifinfo): """ - typ: Annotated[Literal[Typ.REGIONALTARIF], Field(alias="_typ")] = Typ.REGIONALTARIF # type: ignore[assignment] + typ: Annotated[Literal[TypBo.REGIONALTARIF], Field(alias="_typ")] = TypBo.REGIONALTARIF # type: ignore[assignment] preisstand: Optional[pydantic.AwareDatetime] = None """Gibt an, wann der Preis zuletzt angepasst wurde""" berechnungsparameter: Optional["Tarifberechnungsparameter"] = None diff --git a/src/bo4e/bo/standorteigenschaften.py b/src/bo4e/bo/standorteigenschaften.py index 3bab9a0fc..10b75ae3a 100644 --- a/src/bo4e/bo/standorteigenschaften.py +++ b/src/bo4e/bo/standorteigenschaften.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -32,7 +32,7 @@ class Standorteigenschaften(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.STANDORTEIGENSCHAFTEN], Field(alias="_typ")] = Typ.STANDORTEIGENSCHAFTEN + typ: Annotated[Literal[TypBo.STANDORTEIGENSCHAFTEN], Field(alias="_typ")] = TypBo.STANDORTEIGENSCHAFTEN eigenschaften_strom: Optional[list["StandorteigenschaftenStrom"]] = None """Eigenschaften zur Sparte Strom""" diff --git a/src/bo4e/bo/steuerbareressource.py b/src/bo4e/bo/steuerbareressource.py index 4a9dfdb2e..de221c39f 100644 --- a/src/bo4e/bo/steuerbareressource.py +++ b/src/bo4e/bo/steuerbareressource.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -34,7 +34,7 @@ class SteuerbareRessource(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.STEUERBARERESSOURCE], Field(alias="_typ")] = Typ.STEUERBARERESSOURCE + typ: Annotated[Literal[TypBo.STEUERBARERESSOURCE], Field(alias="_typ")] = TypBo.STEUERBARERESSOURCE steuerbare_ressource_id: Optional[str] = None """Id der steuerbaren Ressource""" diff --git a/src/bo4e/bo/tarif.py b/src/bo4e/bo/tarif.py index 3bc2fc1c2..5db2de619 100644 --- a/src/bo4e/bo/tarif.py +++ b/src/bo4e/bo/tarif.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo @@ -37,7 +37,7 @@ class Tarif(Tarifinfo): """ - typ: Annotated[Literal[Typ.TARIF], Field(alias="_typ")] = Typ.TARIF # type: ignore[assignment] + typ: Annotated[Literal[TypBo.TARIF], Field(alias="_typ")] = TypBo.TARIF # type: ignore[assignment] preisstand: Optional[pydantic.AwareDatetime] = None """Gibt an, wann der Preis zuletzt angepasst wurde""" berechnungsparameter: Optional["Tarifberechnungsparameter"] = None diff --git a/src/bo4e/bo/tarifinfo.py b/src/bo4e/bo/tarifinfo.py index ad07a3f7e..f16b926a1 100644 --- a/src/bo4e/bo/tarifinfo.py +++ b/src/bo4e/bo/tarifinfo.py @@ -10,7 +10,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -41,7 +41,7 @@ class Tarifinfo(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.TARIFINFO], Field(alias="_typ")] = Typ.TARIFINFO + typ: Annotated[Literal[TypBo.TARIFINFO], Field(alias="_typ")] = TypBo.TARIFINFO bezeichnung: Optional[str] = None """Name des Tarifs""" anbietername: Optional[str] = None diff --git a/src/bo4e/bo/tarifkosten.py b/src/bo4e/bo/tarifkosten.py index fd851951b..df2d790b3 100644 --- a/src/bo4e/bo/tarifkosten.py +++ b/src/bo4e/bo/tarifkosten.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo @@ -32,7 +32,7 @@ class Tarifkosten(Tarifinfo): """ - typ: Annotated[Literal[Typ.TARIFKOSTEN], Field(alias="_typ")] = Typ.TARIFKOSTEN # type: ignore[assignment] + typ: Annotated[Literal[TypBo.TARIFKOSTEN], Field(alias="_typ")] = TypBo.TARIFKOSTEN # type: ignore[assignment] kosten: Optional["Kosten"] = None """ Referenz (Link) zu einem Kostenobjekt, in dem die Kosten für die Anwendung diff --git a/src/bo4e/bo/tarifpreisblatt.py b/src/bo4e/bo/tarifpreisblatt.py index c24615c70..435ce8e92 100644 --- a/src/bo4e/bo/tarifpreisblatt.py +++ b/src/bo4e/bo/tarifpreisblatt.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo @@ -37,7 +37,7 @@ class Tarifpreisblatt(Tarifinfo): """ - typ: Annotated[Literal[Typ.TARIFPREISBLATT], Field(alias="_typ")] = Typ.TARIFPREISBLATT # type: ignore[assignment] + typ: Annotated[Literal[TypBo.TARIFPREISBLATT], Field(alias="_typ")] = TypBo.TARIFPREISBLATT # type: ignore[assignment] # required attributes (additional to those of Tarifinfo) preisstand: Optional[pydantic.AwareDatetime] = None """Gibt an, wann der Preis zuletzt angepasst wurde""" diff --git a/src/bo4e/bo/technischeressource.py b/src/bo4e/bo/technischeressource.py index 48cfe838d..4f9a4d8cc 100644 --- a/src/bo4e/bo/technischeressource.py +++ b/src/bo4e/bo/technischeressource.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -38,7 +38,7 @@ class TechnischeRessource(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.TECHNISCHERESSOURCE], Field(alias="_typ")] = Typ.TECHNISCHERESSOURCE + typ: Annotated[Literal[TypBo.TECHNISCHERESSOURCE], Field(alias="_typ")] = TypBo.TECHNISCHERESSOURCE technische_ressource_id: Optional[str] = None """Identifikationsnummer einer technischen Ressource""" diff --git a/src/bo4e/bo/vertrag.py b/src/bo4e/bo/vertrag.py index b34ffb561..d060fd940 100644 --- a/src/bo4e/bo/vertrag.py +++ b/src/bo4e/bo/vertrag.py @@ -8,7 +8,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -42,7 +42,7 @@ class Vertrag(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.VERTRAG], Field(alias="_typ")] = Typ.VERTRAG + typ: Annotated[Literal[TypBo.VERTRAG], Field(alias="_typ")] = TypBo.VERTRAG # pylint: disable=duplicate-code vertragsnummer: Optional[str] = None """Eine im Verwendungskontext eindeutige Nummer für den Vertrag""" diff --git a/src/bo4e/bo/zaehler.py b/src/bo4e/bo/zaehler.py index d261d60c6..e11007e7c 100644 --- a/src/bo4e/bo/zaehler.py +++ b/src/bo4e/bo/zaehler.py @@ -12,7 +12,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -46,7 +46,7 @@ class Zaehler(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.ZAEHLER], Field(alias="_typ")] = Typ.ZAEHLER + typ: Annotated[Literal[TypBo.ZAEHLER], Field(alias="_typ")] = TypBo.ZAEHLER zaehlernummer: Optional[str] = None """Nummerierung des Zählers,vergeben durch den Messstellenbetreiber""" sparte: Optional["Sparte"] = None diff --git a/src/bo4e/bo/zeitreihe.py b/src/bo4e/bo/zeitreihe.py index 1c2f85d0e..618a3899d 100644 --- a/src/bo4e/bo/zeitreihe.py +++ b/src/bo4e/bo/zeitreihe.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ_bo import Typ +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -36,7 +36,7 @@ class Zeitreihe(Geschaeftsobjekt): """ - typ: Annotated[Literal[Typ.ZEITREIHE], Field(alias="_typ")] = Typ.ZEITREIHE + typ: Annotated[Literal[TypBo.ZEITREIHE], Field(alias="_typ")] = TypBo.ZEITREIHE bezeichnung: Optional[str] = None """Bezeichnung für die Zeitreihe""" messgroesse: Optional["Messgroesse"] = None From ae88f4842f664e330a08862f4875b9d4d12166c1 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 12:44:08 +0100 Subject: [PATCH 05/26] fix import issues --- src/bo4e/__init__.py | 4 +++- src/bo4e/bo/energiemenge.py | 2 +- src/bo4e/enum/typ_com.py | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bo4e/__init__.py b/src/bo4e/__init__.py index 445c61855..954855c10 100644 --- a/src/bo4e/__init__.py +++ b/src/bo4e/__init__.py @@ -176,7 +176,8 @@ "TechnischeRessourceVerbrauchsart", "Themengebiet", "Titel", - "Typ", + "TypBo", + "TypCom", "Verbrauchsart", "Vertragsart", "Vertragsform", @@ -371,6 +372,7 @@ from .enum.themengebiet import Themengebiet from .enum.titel import Titel from .enum.typ_bo import TypBo +from .enum.typ_com import TypCom from .enum.verbrauchsart import Verbrauchsart from .enum.vertragsart import Vertragsart from .enum.vertragsform import Vertragsform diff --git a/src/bo4e/bo/energiemenge.py b/src/bo4e/bo/energiemenge.py index ce13db9e2..469cb79b2 100644 --- a/src/bo4e/bo/energiemenge.py +++ b/src/bo4e/bo/energiemenge.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBoBo +from ..enum.typ_bo import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/enum/typ_com.py b/src/bo4e/enum/typ_com.py index 5d8f21cac..92c039ea8 100644 --- a/src/bo4e/enum/typ_com.py +++ b/src/bo4e/enum/typ_com.py @@ -16,7 +16,6 @@ class TypCom(StrEnum): AUFABSCHLAGREGIONAL = "AUFABSCHLAGREGIONAL" AUFABSCHLAGSTAFFELPROORT = "AUFABSCHLAGSTAFFELPROORT" AUSSCHREIBUNGSDETAIL = "AUSSCHREIBUNGSDETAIL" - AUSSCHREIBUNGSLOS = "AUSSCHREIBUNGSLOS" BETRAG = "BETRAG" DIENSTLEISTUNG = "DIENSTLEISTUNG" From 4288899ef071d33445a222c229e85061889217fd Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 13:03:59 +0100 Subject: [PATCH 06/26] rename to botyp --- src/bo4e/enum/{typ_bo.py => botyp.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/bo4e/enum/{typ_bo.py => botyp.py} (100%) diff --git a/src/bo4e/enum/typ_bo.py b/src/bo4e/enum/botyp.py similarity index 100% rename from src/bo4e/enum/typ_bo.py rename to src/bo4e/enum/botyp.py From 1a633e7fdff8c1c11e13957b615f53e8303de60b Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 13:04:39 +0100 Subject: [PATCH 07/26] fix imports --- src/bo4e/__init__.py | 2 +- src/bo4e/bo/angebot.py | 2 +- src/bo4e/bo/ausschreibung.py | 2 +- src/bo4e/bo/buendelvertrag.py | 2 +- src/bo4e/bo/energiemenge.py | 2 +- src/bo4e/bo/fremdkosten.py | 2 +- src/bo4e/bo/geraet.py | 2 +- src/bo4e/bo/geschaeftspartner.py | 2 +- src/bo4e/bo/kosten.py | 2 +- src/bo4e/bo/lastgang.py | 2 +- src/bo4e/bo/lokationszuordnung.py | 2 +- src/bo4e/bo/marktlokation.py | 2 +- src/bo4e/bo/marktteilnehmer.py | 2 +- src/bo4e/bo/messlokation.py | 2 +- src/bo4e/bo/netzlokation.py | 2 +- src/bo4e/bo/person.py | 2 +- src/bo4e/bo/preisblatt.py | 2 +- src/bo4e/bo/preisblattdienstleistung.py | 2 +- src/bo4e/bo/preisblatthardware.py | 2 +- src/bo4e/bo/preisblattkonzessionsabgabe.py | 2 +- src/bo4e/bo/preisblattmessung.py | 2 +- src/bo4e/bo/preisblattnetznutzung.py | 2 +- src/bo4e/bo/rechnung.py | 2 +- src/bo4e/bo/region.py | 2 +- src/bo4e/bo/regionaltarif.py | 2 +- src/bo4e/bo/standorteigenschaften.py | 2 +- src/bo4e/bo/steuerbareressource.py | 2 +- src/bo4e/bo/tarif.py | 2 +- src/bo4e/bo/tarifinfo.py | 2 +- src/bo4e/bo/tarifkosten.py | 2 +- src/bo4e/bo/tarifpreisblatt.py | 2 +- src/bo4e/bo/technischeressource.py | 2 +- src/bo4e/bo/vertrag.py | 2 +- src/bo4e/bo/zaehler.py | 2 +- src/bo4e/bo/zeitreihe.py | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/bo4e/__init__.py b/src/bo4e/__init__.py index 954855c10..5dc3cfc5d 100644 --- a/src/bo4e/__init__.py +++ b/src/bo4e/__init__.py @@ -312,6 +312,7 @@ from .enum.befestigungsart import Befestigungsart from .enum.bemessungsgroesse import Bemessungsgroesse from .enum.bilanzierungsmethode import Bilanzierungsmethode +from .enum.botyp import TypBo from .enum.dienstleistungstyp import Dienstleistungstyp from .enum.emobilitaetsart import EMobilitaetsart from .enum.energierichtung import Energierichtung @@ -371,7 +372,6 @@ from .enum.technischeressourceverbrauchsart import TechnischeRessourceVerbrauchsart from .enum.themengebiet import Themengebiet from .enum.titel import Titel -from .enum.typ_bo import TypBo from .enum.typ_com import TypCom from .enum.verbrauchsart import Verbrauchsart from .enum.vertragsart import Vertragsart diff --git a/src/bo4e/bo/angebot.py b/src/bo4e/bo/angebot.py index 3610a06bd..ee2117994 100644 --- a/src/bo4e/bo/angebot.py +++ b/src/bo4e/bo/angebot.py @@ -9,7 +9,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/ausschreibung.py b/src/bo4e/bo/ausschreibung.py index f09afbe7d..9ded531fb 100644 --- a/src/bo4e/bo/ausschreibung.py +++ b/src/bo4e/bo/ausschreibung.py @@ -9,7 +9,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/buendelvertrag.py b/src/bo4e/bo/buendelvertrag.py index e69bac69c..716e20b7c 100644 --- a/src/bo4e/bo/buendelvertrag.py +++ b/src/bo4e/bo/buendelvertrag.py @@ -9,7 +9,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/energiemenge.py b/src/bo4e/bo/energiemenge.py index 469cb79b2..62a89a971 100644 --- a/src/bo4e/bo/energiemenge.py +++ b/src/bo4e/bo/energiemenge.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/fremdkosten.py b/src/bo4e/bo/fremdkosten.py index 239d1d194..c909b6e16 100644 --- a/src/bo4e/bo/fremdkosten.py +++ b/src/bo4e/bo/fremdkosten.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/geraet.py b/src/bo4e/bo/geraet.py index d8a59d76a..b7c80921f 100644 --- a/src/bo4e/bo/geraet.py +++ b/src/bo4e/bo/geraet.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/geschaeftspartner.py b/src/bo4e/bo/geschaeftspartner.py index fbee65628..f5798ee63 100644 --- a/src/bo4e/bo/geschaeftspartner.py +++ b/src/bo4e/bo/geschaeftspartner.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/kosten.py b/src/bo4e/bo/kosten.py index a55446ca8..7494ba889 100644 --- a/src/bo4e/bo/kosten.py +++ b/src/bo4e/bo/kosten.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/lastgang.py b/src/bo4e/bo/lastgang.py index e068d4e15..26388ac28 100644 --- a/src/bo4e/bo/lastgang.py +++ b/src/bo4e/bo/lastgang.py @@ -9,7 +9,7 @@ # pylint: disable=no-name-in-module from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/lokationszuordnung.py b/src/bo4e/bo/lokationszuordnung.py index c6a955a3c..cd61db011 100644 --- a/src/bo4e/bo/lokationszuordnung.py +++ b/src/bo4e/bo/lokationszuordnung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/marktlokation.py b/src/bo4e/bo/marktlokation.py index 2d6163bfe..be3b27802 100644 --- a/src/bo4e/bo/marktlokation.py +++ b/src/bo4e/bo/marktlokation.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/marktteilnehmer.py b/src/bo4e/bo/marktteilnehmer.py index 696f91002..cf670704b 100644 --- a/src/bo4e/bo/marktteilnehmer.py +++ b/src/bo4e/bo/marktteilnehmer.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/messlokation.py b/src/bo4e/bo/messlokation.py index 36e256522..0cdb783dc 100644 --- a/src/bo4e/bo/messlokation.py +++ b/src/bo4e/bo/messlokation.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/netzlokation.py b/src/bo4e/bo/netzlokation.py index 963e53318..542d3b4d8 100644 --- a/src/bo4e/bo/netzlokation.py +++ b/src/bo4e/bo/netzlokation.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/person.py b/src/bo4e/bo/person.py index 99fe0d14d..25873d508 100644 --- a/src/bo4e/bo/person.py +++ b/src/bo4e/bo/person.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/preisblatt.py b/src/bo4e/bo/preisblatt.py index 00655b6ee..2d4a61a7b 100644 --- a/src/bo4e/bo/preisblatt.py +++ b/src/bo4e/bo/preisblatt.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/preisblattdienstleistung.py b/src/bo4e/bo/preisblattdienstleistung.py index 0f79fb733..009ffd20e 100644 --- a/src/bo4e/bo/preisblattdienstleistung.py +++ b/src/bo4e/bo/preisblattdienstleistung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .preisblatt import Preisblatt diff --git a/src/bo4e/bo/preisblatthardware.py b/src/bo4e/bo/preisblatthardware.py index 7553f1abf..a0cd13fa5 100644 --- a/src/bo4e/bo/preisblatthardware.py +++ b/src/bo4e/bo/preisblatthardware.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .preisblatt import Preisblatt diff --git a/src/bo4e/bo/preisblattkonzessionsabgabe.py b/src/bo4e/bo/preisblattkonzessionsabgabe.py index 21ae61c97..1d605b144 100644 --- a/src/bo4e/bo/preisblattkonzessionsabgabe.py +++ b/src/bo4e/bo/preisblattkonzessionsabgabe.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .preisblatt import Preisblatt diff --git a/src/bo4e/bo/preisblattmessung.py b/src/bo4e/bo/preisblattmessung.py index 36ab012fb..05e06ae6a 100644 --- a/src/bo4e/bo/preisblattmessung.py +++ b/src/bo4e/bo/preisblattmessung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .preisblatt import Preisblatt diff --git a/src/bo4e/bo/preisblattnetznutzung.py b/src/bo4e/bo/preisblattnetznutzung.py index 076efa392..95ce50a3e 100644 --- a/src/bo4e/bo/preisblattnetznutzung.py +++ b/src/bo4e/bo/preisblattnetznutzung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .preisblatt import Preisblatt diff --git a/src/bo4e/bo/rechnung.py b/src/bo4e/bo/rechnung.py index ad808bad1..a90ca2304 100644 --- a/src/bo4e/bo/rechnung.py +++ b/src/bo4e/bo/rechnung.py @@ -8,7 +8,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/region.py b/src/bo4e/bo/region.py index 87ce9baa3..0b5b5d255 100644 --- a/src/bo4e/bo/region.py +++ b/src/bo4e/bo/region.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/regionaltarif.py b/src/bo4e/bo/regionaltarif.py index 145e3aacc..8ba627190 100644 --- a/src/bo4e/bo/regionaltarif.py +++ b/src/bo4e/bo/regionaltarif.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from .tarifinfo import Tarifinfo if TYPE_CHECKING: diff --git a/src/bo4e/bo/standorteigenschaften.py b/src/bo4e/bo/standorteigenschaften.py index 10b75ae3a..657cfcde8 100644 --- a/src/bo4e/bo/standorteigenschaften.py +++ b/src/bo4e/bo/standorteigenschaften.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/steuerbareressource.py b/src/bo4e/bo/steuerbareressource.py index de221c39f..f71affa05 100644 --- a/src/bo4e/bo/steuerbareressource.py +++ b/src/bo4e/bo/steuerbareressource.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/tarif.py b/src/bo4e/bo/tarif.py index 5db2de619..7f8785042 100644 --- a/src/bo4e/bo/tarif.py +++ b/src/bo4e/bo/tarif.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo diff --git a/src/bo4e/bo/tarifinfo.py b/src/bo4e/bo/tarifinfo.py index f16b926a1..c7e010272 100644 --- a/src/bo4e/bo/tarifinfo.py +++ b/src/bo4e/bo/tarifinfo.py @@ -10,7 +10,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/tarifkosten.py b/src/bo4e/bo/tarifkosten.py index df2d790b3..45b813067 100644 --- a/src/bo4e/bo/tarifkosten.py +++ b/src/bo4e/bo/tarifkosten.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo diff --git a/src/bo4e/bo/tarifpreisblatt.py b/src/bo4e/bo/tarifpreisblatt.py index 435ce8e92..de3ebc96b 100644 --- a/src/bo4e/bo/tarifpreisblatt.py +++ b/src/bo4e/bo/tarifpreisblatt.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo diff --git a/src/bo4e/bo/technischeressource.py b/src/bo4e/bo/technischeressource.py index 4f9a4d8cc..7d4aed4cb 100644 --- a/src/bo4e/bo/technischeressource.py +++ b/src/bo4e/bo/technischeressource.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/vertrag.py b/src/bo4e/bo/vertrag.py index d060fd940..672a42c3c 100644 --- a/src/bo4e/bo/vertrag.py +++ b/src/bo4e/bo/vertrag.py @@ -8,7 +8,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/zaehler.py b/src/bo4e/bo/zaehler.py index e11007e7c..788564b6f 100644 --- a/src/bo4e/bo/zaehler.py +++ b/src/bo4e/bo/zaehler.py @@ -12,7 +12,7 @@ import pydantic from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt diff --git a/src/bo4e/bo/zeitreihe.py b/src/bo4e/bo/zeitreihe.py index 618a3899d..9505013fd 100644 --- a/src/bo4e/bo/zeitreihe.py +++ b/src/bo4e/bo/zeitreihe.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.typ_bo import TypBo +from ..enum.botyp import TypBo from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt From 3ad3d78a08d6823dc7edb85b7a7a5c635978a52c Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 13:06:40 +0100 Subject: [PATCH 08/26] rename class to BoTyp --- src/bo4e/__init__.py | 4 ++-- src/bo4e/bo/angebot.py | 4 ++-- src/bo4e/bo/ausschreibung.py | 4 ++-- src/bo4e/bo/buendelvertrag.py | 4 ++-- src/bo4e/bo/energiemenge.py | 4 ++-- src/bo4e/bo/fremdkosten.py | 4 ++-- src/bo4e/bo/geraet.py | 4 ++-- src/bo4e/bo/geschaeftspartner.py | 4 ++-- src/bo4e/bo/kosten.py | 4 ++-- src/bo4e/bo/lastgang.py | 4 ++-- src/bo4e/bo/lokationszuordnung.py | 4 ++-- src/bo4e/bo/marktlokation.py | 4 ++-- src/bo4e/bo/marktteilnehmer.py | 4 ++-- src/bo4e/bo/messlokation.py | 4 ++-- src/bo4e/bo/netzlokation.py | 4 ++-- src/bo4e/bo/person.py | 4 ++-- src/bo4e/bo/preisblatt.py | 4 ++-- src/bo4e/bo/preisblattdienstleistung.py | 6 +++--- src/bo4e/bo/preisblatthardware.py | 6 +++--- src/bo4e/bo/preisblattkonzessionsabgabe.py | 6 +++--- src/bo4e/bo/preisblattmessung.py | 6 +++--- src/bo4e/bo/preisblattnetznutzung.py | 6 +++--- src/bo4e/bo/rechnung.py | 4 ++-- src/bo4e/bo/region.py | 4 ++-- src/bo4e/bo/regionaltarif.py | 4 ++-- src/bo4e/bo/standorteigenschaften.py | 4 ++-- src/bo4e/bo/steuerbareressource.py | 4 ++-- src/bo4e/bo/tarif.py | 4 ++-- src/bo4e/bo/tarifinfo.py | 4 ++-- src/bo4e/bo/tarifkosten.py | 4 ++-- src/bo4e/bo/tarifpreisblatt.py | 4 ++-- src/bo4e/bo/technischeressource.py | 4 ++-- src/bo4e/bo/vertrag.py | 4 ++-- src/bo4e/bo/zaehler.py | 4 ++-- src/bo4e/bo/zeitreihe.py | 4 ++-- src/bo4e/enum/botyp.py | 2 +- 36 files changed, 76 insertions(+), 76 deletions(-) diff --git a/src/bo4e/__init__.py b/src/bo4e/__init__.py index 5dc3cfc5d..e1ef8e0fd 100644 --- a/src/bo4e/__init__.py +++ b/src/bo4e/__init__.py @@ -176,7 +176,7 @@ "TechnischeRessourceVerbrauchsart", "Themengebiet", "Titel", - "TypBo", + "BoTyp", "TypCom", "Verbrauchsart", "Vertragsart", @@ -312,7 +312,7 @@ from .enum.befestigungsart import Befestigungsart from .enum.bemessungsgroesse import Bemessungsgroesse from .enum.bilanzierungsmethode import Bilanzierungsmethode -from .enum.botyp import TypBo +from .enum.botyp import BoTyp from .enum.dienstleistungstyp import Dienstleistungstyp from .enum.emobilitaetsart import EMobilitaetsart from .enum.energierichtung import Energierichtung diff --git a/src/bo4e/bo/angebot.py b/src/bo4e/bo/angebot.py index ee2117994..2a19a09b5 100644 --- a/src/bo4e/bo/angebot.py +++ b/src/bo4e/bo/angebot.py @@ -9,7 +9,7 @@ import pydantic from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -38,7 +38,7 @@ class Angebot(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.ANGEBOT], Field(alias="_typ")] = TypBo.ANGEBOT + typ: Annotated[Literal[BoTyp.ANGEBOT], Field(alias="_typ")] = BoTyp.ANGEBOT angebotsnummer: Optional[str] = None """Eindeutige Nummer des Angebotes""" angebotsdatum: Optional[pydantic.AwareDatetime] = None diff --git a/src/bo4e/bo/ausschreibung.py b/src/bo4e/bo/ausschreibung.py index 9ded531fb..fb973fe39 100644 --- a/src/bo4e/bo/ausschreibung.py +++ b/src/bo4e/bo/ausschreibung.py @@ -9,7 +9,7 @@ import pydantic from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -36,7 +36,7 @@ class Ausschreibung(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.AUSSCHREIBUNG], Field(alias="_typ")] = TypBo.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 diff --git a/src/bo4e/bo/buendelvertrag.py b/src/bo4e/bo/buendelvertrag.py index 716e20b7c..35e3cf522 100644 --- a/src/bo4e/bo/buendelvertrag.py +++ b/src/bo4e/bo/buendelvertrag.py @@ -9,7 +9,7 @@ import pydantic from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -38,7 +38,7 @@ class Buendelvertrag(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.BUENDELVERTRAG], Field(alias="_typ")] = TypBo.BUENDELVERTRAG + typ: Annotated[Literal[BoTyp.BUENDELVERTRAG], Field(alias="_typ")] = BoTyp.BUENDELVERTRAG # pylint: disable=duplicate-code vertragsnummer: Optional[str] = None diff --git a/src/bo4e/bo/energiemenge.py b/src/bo4e/bo/energiemenge.py index 62a89a971..466a4d9ae 100644 --- a/src/bo4e/bo/energiemenge.py +++ b/src/bo4e/bo/energiemenge.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -34,7 +34,7 @@ class Energiemenge(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.ENERGIEMENGE], Field(alias="_typ")] = TypBo.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""" # todo: add validator such that only mess- or marktlokations IDs are accepted + cross check with lokationstyp diff --git a/src/bo4e/bo/fremdkosten.py b/src/bo4e/bo/fremdkosten.py index c909b6e16..1017818a8 100644 --- a/src/bo4e/bo/fremdkosten.py +++ b/src/bo4e/bo/fremdkosten.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -35,7 +35,7 @@ class Fremdkosten(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.FREMDKOSTEN], Field(alias="_typ")] = TypBo.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 diff --git a/src/bo4e/bo/geraet.py b/src/bo4e/bo/geraet.py index b7c80921f..30f1ed505 100644 --- a/src/bo4e/bo/geraet.py +++ b/src/bo4e/bo/geraet.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -33,7 +33,7 @@ class Geraet(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.GERAET], Field(alias="_typ")] = TypBo.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.""" diff --git a/src/bo4e/bo/geschaeftspartner.py b/src/bo4e/bo/geschaeftspartner.py index f5798ee63..c9995c735 100644 --- a/src/bo4e/bo/geschaeftspartner.py +++ b/src/bo4e/bo/geschaeftspartner.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -39,7 +39,7 @@ class Geschaeftspartner(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.GESCHAEFTSPARTNER], Field(alias="_typ")] = TypBo.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 diff --git a/src/bo4e/bo/kosten.py b/src/bo4e/bo/kosten.py index 7494ba889..431f3e417 100644 --- a/src/bo4e/bo/kosten.py +++ b/src/bo4e/bo/kosten.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -36,7 +36,7 @@ class Kosten(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.KOSTEN], Field(alias="_typ")] = TypBo.KOSTEN + typ: Annotated[Literal[BoTyp.KOSTEN], Field(alias="_typ")] = BoTyp.KOSTEN kostenklasse: Optional["Kostenklasse"] = None """Klasse der Kosten, beispielsweise Fremdkosten""" gueltigkeit: Optional["Zeitraum"] = None diff --git a/src/bo4e/bo/lastgang.py b/src/bo4e/bo/lastgang.py index 26388ac28..8e8fa89b2 100644 --- a/src/bo4e/bo/lastgang.py +++ b/src/bo4e/bo/lastgang.py @@ -9,7 +9,7 @@ # pylint: disable=no-name-in-module from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -40,7 +40,7 @@ class Lastgang(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.LASTGANG], Field(alias="_typ")] = TypBo.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 diff --git a/src/bo4e/bo/lokationszuordnung.py b/src/bo4e/bo/lokationszuordnung.py index cd61db011..963a470a8 100644 --- a/src/bo4e/bo/lokationszuordnung.py +++ b/src/bo4e/bo/lokationszuordnung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -33,7 +33,7 @@ class Lokationszuordnung(Geschaeftsobjekt): `Lokationszuordnung JSON Schema `_ """ - typ: Annotated[Literal[TypBo.LOKATIONSZUORDNUNG], Field(alias="_typ")] = TypBo.LOKATIONSZUORDNUNG + typ: Annotated[Literal[BoTyp.LOKATIONSZUORDNUNG], Field(alias="_typ")] = BoTyp.LOKATIONSZUORDNUNG marktlokationen: Optional[list["Marktlokation"]] = None """Liste mit referenzierten Marktlokationen""" diff --git a/src/bo4e/bo/marktlokation.py b/src/bo4e/bo/marktlokation.py index be3b27802..c032e13e8 100644 --- a/src/bo4e/bo/marktlokation.py +++ b/src/bo4e/bo/marktlokation.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -46,7 +46,7 @@ class Marktlokation(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.MARKTLOKATION], Field(alias="_typ")] = TypBo.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.""" diff --git a/src/bo4e/bo/marktteilnehmer.py b/src/bo4e/bo/marktteilnehmer.py index cf670704b..863b2c743 100644 --- a/src/bo4e/bo/marktteilnehmer.py +++ b/src/bo4e/bo/marktteilnehmer.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -34,7 +34,7 @@ class Marktteilnehmer(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.MARKTTEILNEHMER], Field(alias="_typ")] = TypBo.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 diff --git a/src/bo4e/bo/messlokation.py b/src/bo4e/bo/messlokation.py index 0cdb783dc..28cf3f4a0 100644 --- a/src/bo4e/bo/messlokation.py +++ b/src/bo4e/bo/messlokation.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -39,7 +39,7 @@ class Messlokation(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.MESSLOKATION], Field(alias="_typ")] = TypBo.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""" diff --git a/src/bo4e/bo/netzlokation.py b/src/bo4e/bo/netzlokation.py index 542d3b4d8..38616ca04 100644 --- a/src/bo4e/bo/netzlokation.py +++ b/src/bo4e/bo/netzlokation.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -37,7 +37,7 @@ class Netzlokation(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.NETZLOKATION], Field(alias="_typ")] = TypBo.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""" diff --git a/src/bo4e/bo/person.py b/src/bo4e/bo/person.py index 25873d508..b64d10cec 100644 --- a/src/bo4e/bo/person.py +++ b/src/bo4e/bo/person.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -37,7 +37,7 @@ class Person(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.PERSON], Field(alias="_typ")] = TypBo.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 diff --git a/src/bo4e/bo/preisblatt.py b/src/bo4e/bo/preisblatt.py index 2d4a61a7b..0102a15e9 100644 --- a/src/bo4e/bo/preisblatt.py +++ b/src/bo4e/bo/preisblatt.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -40,7 +40,7 @@ class Preisblatt(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.PREISBLATT], Field(alias="_typ")] = TypBo.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 diff --git a/src/bo4e/bo/preisblattdienstleistung.py b/src/bo4e/bo/preisblattdienstleistung.py index 009ffd20e..a5c0863ec 100644 --- a/src/bo4e/bo/preisblattdienstleistung.py +++ b/src/bo4e/bo/preisblattdienstleistung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .preisblatt import Preisblatt @@ -33,8 +33,8 @@ class PreisblattDienstleistung(Preisblatt): """ - typ: Annotated[Literal[TypBo.PREISBLATTDIENSTLEISTUNG], Field(alias="_typ")] = ( - TypBo.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 diff --git a/src/bo4e/bo/preisblatthardware.py b/src/bo4e/bo/preisblatthardware.py index a0cd13fa5..74ffe1d0a 100644 --- a/src/bo4e/bo/preisblatthardware.py +++ b/src/bo4e/bo/preisblatthardware.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .preisblatt import Preisblatt @@ -34,8 +34,8 @@ class PreisblattHardware(Preisblatt): """ - typ: Annotated[Literal[TypBo.PREISBLATTHARDWARE], Field(alias="_typ")] = ( - TypBo.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 diff --git a/src/bo4e/bo/preisblattkonzessionsabgabe.py b/src/bo4e/bo/preisblattkonzessionsabgabe.py index 1d605b144..062a25ee4 100644 --- a/src/bo4e/bo/preisblattkonzessionsabgabe.py +++ b/src/bo4e/bo/preisblattkonzessionsabgabe.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .preisblatt import Preisblatt @@ -31,8 +31,8 @@ class PreisblattKonzessionsabgabe(Preisblatt): """ - typ: Annotated[Literal[TypBo.PREISBLATTKONZESSIONSABGABE], Field(alias="_typ")] = ( - TypBo.PREISBLATTKONZESSIONSABGABE # type: ignore[assignment] + typ: Annotated[Literal[BoTyp.PREISBLATTKONZESSIONSABGABE], Field(alias="_typ")] = ( + BoTyp.PREISBLATTKONZESSIONSABGABE # type: ignore[assignment] ) # required attributes (additional to those of Preisblatt) kundengruppe_k_a: Optional["KundengruppeKA"] = None diff --git a/src/bo4e/bo/preisblattmessung.py b/src/bo4e/bo/preisblattmessung.py index 05e06ae6a..a448b5903 100644 --- a/src/bo4e/bo/preisblattmessung.py +++ b/src/bo4e/bo/preisblattmessung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .preisblatt import Preisblatt @@ -35,8 +35,8 @@ class PreisblattMessung(Preisblatt): """ - typ: Annotated[Literal[TypBo.PREISBLATTMESSUNG], Field(alias="_typ")] = ( - TypBo.PREISBLATTMESSUNG # type: ignore[assignment] + typ: Annotated[Literal[BoTyp.PREISBLATTMESSUNG], Field(alias="_typ")] = ( + BoTyp.PREISBLATTMESSUNG # type: ignore[assignment] ) # required attributes (additional to those of Preisblatt) bilanzierungsmethode: Optional["Bilanzierungsmethode"] = None diff --git a/src/bo4e/bo/preisblattnetznutzung.py b/src/bo4e/bo/preisblattnetznutzung.py index 95ce50a3e..f120d575f 100644 --- a/src/bo4e/bo/preisblattnetznutzung.py +++ b/src/bo4e/bo/preisblattnetznutzung.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .preisblatt import Preisblatt @@ -33,8 +33,8 @@ class PreisblattNetznutzung(Preisblatt): """ - typ: Annotated[Literal[TypBo.PREISBLATTNETZNUTZUNG], Field(alias="_typ")] = ( - TypBo.PREISBLATTNETZNUTZUNG # type: ignore[assignment] + typ: Annotated[Literal[BoTyp.PREISBLATTNETZNUTZUNG], Field(alias="_typ")] = ( + BoTyp.PREISBLATTNETZNUTZUNG # type: ignore[assignment] ) # required attributes (additional to those of Preisblatt) bilanzierungsmethode: Optional["Bilanzierungsmethode"] = None diff --git a/src/bo4e/bo/rechnung.py b/src/bo4e/bo/rechnung.py index a90ca2304..e738bcaa7 100644 --- a/src/bo4e/bo/rechnung.py +++ b/src/bo4e/bo/rechnung.py @@ -8,7 +8,7 @@ import pydantic from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -43,7 +43,7 @@ class Rechnung(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.RECHNUNG], Field(alias="_typ")] = TypBo.RECHNUNG + typ: Annotated[Literal[BoTyp.RECHNUNG], Field(alias="_typ")] = BoTyp.RECHNUNG ist_storno: Optional[bool] = None """ Kennzeichnung, ob es sich um eine Stornorechnung handelt; diff --git a/src/bo4e/bo/region.py b/src/bo4e/bo/region.py index 0b5b5d255..34825f0b4 100644 --- a/src/bo4e/bo/region.py +++ b/src/bo4e/bo/region.py @@ -6,7 +6,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -32,7 +32,7 @@ class Region(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.REGION], Field(alias="_typ")] = TypBo.REGION + typ: Annotated[Literal[BoTyp.REGION], Field(alias="_typ")] = BoTyp.REGION bezeichnung: Optional[str] = None """Bezeichnung der Region""" diff --git a/src/bo4e/bo/regionaltarif.py b/src/bo4e/bo/regionaltarif.py index 8ba627190..482a246d3 100644 --- a/src/bo4e/bo/regionaltarif.py +++ b/src/bo4e/bo/regionaltarif.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from .tarifinfo import Tarifinfo if TYPE_CHECKING: @@ -35,7 +35,7 @@ class Regionaltarif(Tarifinfo): """ - typ: Annotated[Literal[TypBo.REGIONALTARIF], Field(alias="_typ")] = TypBo.REGIONALTARIF # type: ignore[assignment] + typ: Annotated[Literal[BoTyp.REGIONALTARIF], Field(alias="_typ")] = BoTyp.REGIONALTARIF # type: ignore[assignment] preisstand: Optional[pydantic.AwareDatetime] = None """Gibt an, wann der Preis zuletzt angepasst wurde""" berechnungsparameter: Optional["Tarifberechnungsparameter"] = None diff --git a/src/bo4e/bo/standorteigenschaften.py b/src/bo4e/bo/standorteigenschaften.py index 657cfcde8..c13c600cb 100644 --- a/src/bo4e/bo/standorteigenschaften.py +++ b/src/bo4e/bo/standorteigenschaften.py @@ -9,7 +9,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -32,7 +32,7 @@ class Standorteigenschaften(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.STANDORTEIGENSCHAFTEN], Field(alias="_typ")] = TypBo.STANDORTEIGENSCHAFTEN + typ: Annotated[Literal[BoTyp.STANDORTEIGENSCHAFTEN], Field(alias="_typ")] = BoTyp.STANDORTEIGENSCHAFTEN eigenschaften_strom: Optional[list["StandorteigenschaftenStrom"]] = None """Eigenschaften zur Sparte Strom""" diff --git a/src/bo4e/bo/steuerbareressource.py b/src/bo4e/bo/steuerbareressource.py index f71affa05..68afe5db3 100644 --- a/src/bo4e/bo/steuerbareressource.py +++ b/src/bo4e/bo/steuerbareressource.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -34,7 +34,7 @@ class SteuerbareRessource(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.STEUERBARERESSOURCE], Field(alias="_typ")] = TypBo.STEUERBARERESSOURCE + typ: Annotated[Literal[BoTyp.STEUERBARERESSOURCE], Field(alias="_typ")] = BoTyp.STEUERBARERESSOURCE steuerbare_ressource_id: Optional[str] = None """Id der steuerbaren Ressource""" diff --git a/src/bo4e/bo/tarif.py b/src/bo4e/bo/tarif.py index 7f8785042..480692090 100644 --- a/src/bo4e/bo/tarif.py +++ b/src/bo4e/bo/tarif.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo @@ -37,7 +37,7 @@ class Tarif(Tarifinfo): """ - typ: Annotated[Literal[TypBo.TARIF], Field(alias="_typ")] = TypBo.TARIF # type: ignore[assignment] + typ: Annotated[Literal[BoTyp.TARIF], Field(alias="_typ")] = BoTyp.TARIF # type: ignore[assignment] preisstand: Optional[pydantic.AwareDatetime] = None """Gibt an, wann der Preis zuletzt angepasst wurde""" berechnungsparameter: Optional["Tarifberechnungsparameter"] = None diff --git a/src/bo4e/bo/tarifinfo.py b/src/bo4e/bo/tarifinfo.py index c7e010272..76f3f2cd2 100644 --- a/src/bo4e/bo/tarifinfo.py +++ b/src/bo4e/bo/tarifinfo.py @@ -10,7 +10,7 @@ import pydantic from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -41,7 +41,7 @@ class Tarifinfo(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.TARIFINFO], Field(alias="_typ")] = TypBo.TARIFINFO + typ: Annotated[Literal[BoTyp.TARIFINFO], Field(alias="_typ")] = BoTyp.TARIFINFO bezeichnung: Optional[str] = None """Name des Tarifs""" anbietername: Optional[str] = None diff --git a/src/bo4e/bo/tarifkosten.py b/src/bo4e/bo/tarifkosten.py index 45b813067..d87083f31 100644 --- a/src/bo4e/bo/tarifkosten.py +++ b/src/bo4e/bo/tarifkosten.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo @@ -32,7 +32,7 @@ class Tarifkosten(Tarifinfo): """ - typ: Annotated[Literal[TypBo.TARIFKOSTEN], Field(alias="_typ")] = TypBo.TARIFKOSTEN # type: ignore[assignment] + typ: Annotated[Literal[BoTyp.TARIFKOSTEN], Field(alias="_typ")] = BoTyp.TARIFKOSTEN # type: ignore[assignment] kosten: Optional["Kosten"] = None """ Referenz (Link) zu einem Kostenobjekt, in dem die Kosten für die Anwendung diff --git a/src/bo4e/bo/tarifpreisblatt.py b/src/bo4e/bo/tarifpreisblatt.py index de3ebc96b..25573f36b 100644 --- a/src/bo4e/bo/tarifpreisblatt.py +++ b/src/bo4e/bo/tarifpreisblatt.py @@ -7,7 +7,7 @@ import pydantic from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .tarifinfo import Tarifinfo @@ -37,7 +37,7 @@ class Tarifpreisblatt(Tarifinfo): """ - typ: Annotated[Literal[TypBo.TARIFPREISBLATT], Field(alias="_typ")] = TypBo.TARIFPREISBLATT # type: ignore[assignment] + typ: Annotated[Literal[BoTyp.TARIFPREISBLATT], Field(alias="_typ")] = BoTyp.TARIFPREISBLATT # type: ignore[assignment] # required attributes (additional to those of Tarifinfo) preisstand: Optional[pydantic.AwareDatetime] = None """Gibt an, wann der Preis zuletzt angepasst wurde""" diff --git a/src/bo4e/bo/technischeressource.py b/src/bo4e/bo/technischeressource.py index 7d4aed4cb..5c76d6d33 100644 --- a/src/bo4e/bo/technischeressource.py +++ b/src/bo4e/bo/technischeressource.py @@ -7,7 +7,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -38,7 +38,7 @@ class TechnischeRessource(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.TECHNISCHERESSOURCE], Field(alias="_typ")] = TypBo.TECHNISCHERESSOURCE + typ: Annotated[Literal[BoTyp.TECHNISCHERESSOURCE], Field(alias="_typ")] = BoTyp.TECHNISCHERESSOURCE technische_ressource_id: Optional[str] = None """Identifikationsnummer einer technischen Ressource""" diff --git a/src/bo4e/bo/vertrag.py b/src/bo4e/bo/vertrag.py index 672a42c3c..6f0eb412c 100644 --- a/src/bo4e/bo/vertrag.py +++ b/src/bo4e/bo/vertrag.py @@ -8,7 +8,7 @@ import pydantic from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -42,7 +42,7 @@ class Vertrag(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.VERTRAG], Field(alias="_typ")] = TypBo.VERTRAG + typ: Annotated[Literal[BoTyp.VERTRAG], Field(alias="_typ")] = BoTyp.VERTRAG # pylint: disable=duplicate-code vertragsnummer: Optional[str] = None """Eine im Verwendungskontext eindeutige Nummer für den Vertrag""" diff --git a/src/bo4e/bo/zaehler.py b/src/bo4e/bo/zaehler.py index 788564b6f..211ae5f3f 100644 --- a/src/bo4e/bo/zaehler.py +++ b/src/bo4e/bo/zaehler.py @@ -12,7 +12,7 @@ import pydantic from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -46,7 +46,7 @@ class Zaehler(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.ZAEHLER], Field(alias="_typ")] = TypBo.ZAEHLER + typ: Annotated[Literal[BoTyp.ZAEHLER], Field(alias="_typ")] = BoTyp.ZAEHLER zaehlernummer: Optional[str] = None """Nummerierung des Zählers,vergeben durch den Messstellenbetreiber""" sparte: Optional["Sparte"] = None diff --git a/src/bo4e/bo/zeitreihe.py b/src/bo4e/bo/zeitreihe.py index 9505013fd..21de001bc 100644 --- a/src/bo4e/bo/zeitreihe.py +++ b/src/bo4e/bo/zeitreihe.py @@ -8,7 +8,7 @@ from pydantic import Field -from ..enum.botyp import TypBo +from ..enum.botyp import BoTyp from ..utils import postprocess_docstring from .geschaeftsobjekt import Geschaeftsobjekt @@ -36,7 +36,7 @@ class Zeitreihe(Geschaeftsobjekt): """ - typ: Annotated[Literal[TypBo.ZEITREIHE], Field(alias="_typ")] = TypBo.ZEITREIHE + typ: Annotated[Literal[BoTyp.ZEITREIHE], Field(alias="_typ")] = BoTyp.ZEITREIHE bezeichnung: Optional[str] = None """Bezeichnung für die Zeitreihe""" messgroesse: Optional["Messgroesse"] = None diff --git a/src/bo4e/enum/botyp.py b/src/bo4e/enum/botyp.py index 2aea01491..0ac9b9631 100644 --- a/src/bo4e/enum/botyp.py +++ b/src/bo4e/enum/botyp.py @@ -2,7 +2,7 @@ from bo4e.enum.strenum import StrEnum -class TypBo(StrEnum): +class BoTyp(StrEnum): """ Auflistung sämtlicher existierender Geschäftsobjekte. """ From ae3036113e90a9dccca3976a4eb0540a6ed55a88 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 13:07:39 +0100 Subject: [PATCH 09/26] rename to comtyp --- src/bo4e/__init__.py | 4 ++-- src/bo4e/enum/{typ_com.py => comtyp.py} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/bo4e/enum/{typ_com.py => comtyp.py} (99%) diff --git a/src/bo4e/__init__.py b/src/bo4e/__init__.py index e1ef8e0fd..00c07c08a 100644 --- a/src/bo4e/__init__.py +++ b/src/bo4e/__init__.py @@ -177,7 +177,7 @@ "Themengebiet", "Titel", "BoTyp", - "TypCom", + "ComTyp", "Verbrauchsart", "Vertragsart", "Vertragsform", @@ -313,6 +313,7 @@ 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 @@ -372,7 +373,6 @@ from .enum.technischeressourceverbrauchsart import TechnischeRessourceVerbrauchsart from .enum.themengebiet import Themengebiet from .enum.titel import Titel -from .enum.typ_com import TypCom from .enum.verbrauchsart import Verbrauchsart from .enum.vertragsart import Vertragsart from .enum.vertragsform import Vertragsform diff --git a/src/bo4e/enum/typ_com.py b/src/bo4e/enum/comtyp.py similarity index 99% rename from src/bo4e/enum/typ_com.py rename to src/bo4e/enum/comtyp.py index 92c039ea8..e844abb91 100644 --- a/src/bo4e/enum/typ_com.py +++ b/src/bo4e/enum/comtyp.py @@ -2,7 +2,7 @@ from bo4e.enum.strenum import StrEnum -class TypCom(StrEnum): +class ComTyp(StrEnum): """ Auflistung sämtlicher existierender Geschäftsobjekte. """ From 465fe973c1ea845eb47d94c8826b758686953f09 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 13:34:09 +0100 Subject: [PATCH 10/26] add missing coms --- src/bo4e/enum/comtyp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bo4e/enum/comtyp.py b/src/bo4e/enum/comtyp.py index e844abb91..2f4d53f4f 100644 --- a/src/bo4e/enum/comtyp.py +++ b/src/bo4e/enum/comtyp.py @@ -31,6 +31,7 @@ class ComTyp(StrEnum): KOSTENBLOCK = "KOSTENBLOCK" KOSTENPOSITION = "KOSTENPOSITION" KRITERIUMWERT = "KRITERIUMWERT" + LASTPROFIL = "LASTPROFIL" MARKTGEBIETINFO = "MARKTGEBIETINFO" MENGE = "MENGE" POSITIONSAUFABSCHLAG = "POSITIONSAUFABSCHLAG" @@ -49,6 +50,7 @@ class ComTyp(StrEnum): STANDORTEIGENSCHAFTENGAS = "STANDORTEIGENSCHAFTENGAS" STANDORTEIGENSCHAFTENSTROM = "STANDORTEIGENSCHAFTENSTROM" STEUERBETRAG = "STEUERBETRAG" + TAGESPARAMETER = "TAGESPARAMETER" TARIFBERECHNUNGSPARAMETER = "TARIFBERECHNUNGSPARAMETER" TARIFEINSCHRAENKUNG = "TARIFEINSCHRAENKUNG" TARIFPREIS = "TARIFPREIS" From 56d698bd098ad7d8f8cbe43d37d073ad8e5187fa Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 13:34:41 +0100 Subject: [PATCH 11/26] add default types for coms --- src/bo4e/com/adresse.py | 7 ++++++- src/bo4e/com/angebotsposition.py | 7 ++++++- src/bo4e/com/angebotsteil.py | 7 ++++++- src/bo4e/com/angebotsvariante.py | 6 +++++- src/bo4e/com/aufabschlag.py | 7 ++++++- src/bo4e/com/aufabschlagproort.py | 7 ++++++- src/bo4e/com/aufabschlagregional.py | 6 +++++- src/bo4e/com/aufabschlagstaffelproort.py | 7 ++++++- src/bo4e/com/ausschreibungsdetail.py | 7 ++++++- src/bo4e/com/ausschreibungslos.py | 7 ++++++- src/bo4e/com/betrag.py | 7 ++++++- src/bo4e/com/dienstleistung.py | 7 ++++++- src/bo4e/com/energieherkunft.py | 7 ++++++- src/bo4e/com/energiemix.py | 7 ++++++- src/bo4e/com/fremdkostenblock.py | 7 ++++++- src/bo4e/com/fremdkostenposition.py | 7 ++++++- src/bo4e/com/geokoordinaten.py | 7 ++++++- src/bo4e/com/katasteradresse.py | 7 ++++++- src/bo4e/com/konfigurationsprodukt.py | 7 ++++++- src/bo4e/com/kontaktweg.py | 7 ++++++- src/bo4e/com/konzessionsabgabe.py | 7 ++++++- src/bo4e/com/kostenblock.py | 7 ++++++- src/bo4e/com/kostenposition.py | 6 +++++- src/bo4e/com/kriteriumwert.py | 7 ++++++- src/bo4e/com/lastprofil.py | 7 ++++++- src/bo4e/com/marktgebietinfo.py | 7 ++++++- src/bo4e/com/menge.py | 7 ++++++- src/bo4e/com/positionsaufabschlag.py | 7 ++++++- src/bo4e/com/preis.py | 6 +++++- src/bo4e/com/preisgarantie.py | 7 ++++++- src/bo4e/com/preisposition.py | 7 ++++++- src/bo4e/com/preisstaffel.py | 7 ++++++- src/bo4e/com/rechnungsposition.py | 6 +++++- src/bo4e/com/regionalegueltigkeit.py | 7 ++++++- src/bo4e/com/regionalepreisgarantie.py | 7 ++++++- src/bo4e/com/regionalepreisstaffel.py | 7 ++++++- src/bo4e/com/regionaleraufabschlag.py | 8 +++++++- src/bo4e/com/regionaletarifpreisposition.py | 9 ++++++++- src/bo4e/com/regionskriterium.py | 7 ++++++- src/bo4e/com/sigmoidparameter.py | 7 ++++++- src/bo4e/com/standorteigenschaftengas.py | 6 +++++- src/bo4e/com/standorteigenschaftenstrom.py | 6 +++++- src/bo4e/com/steuerbetrag.py | 7 ++++++- src/bo4e/com/tagesparameter.py | 8 +++++++- src/bo4e/com/tarifberechnungsparameter.py | 7 +++++-- src/bo4e/com/tarifeinschraenkung.py | 7 ++++++- src/bo4e/com/tarifpreis.py | 7 ++++++- src/bo4e/com/tarifpreisposition.py | 7 ++++++- src/bo4e/com/tarifpreispositionproort.py | 7 ++++++- src/bo4e/com/tarifpreisstaffelproort.py | 7 ++++++- src/bo4e/com/unterschrift.py | 6 +++++- src/bo4e/com/verbrauch.py | 6 +++++- src/bo4e/com/vertragskonditionen.py | 7 ++++++- src/bo4e/com/vertragsteil.py | 6 +++++- src/bo4e/com/verwendungszweckpromarktrolle.py | 9 ++++++++- src/bo4e/com/zaehlwerk.py | 7 ++++++- src/bo4e/com/zaehlzeitregister.py | 9 +++++++-- src/bo4e/com/zeitraum.py | 7 ++++++- src/bo4e/com/zeitreihenwert.py | 7 ++++++- src/bo4e/com/zustaendigkeit.py | 6 +++++- 60 files changed, 355 insertions(+), 62 deletions(-) diff --git a/src/bo4e/com/adresse.py b/src/bo4e/com/adresse.py index 43b5d09a3..ab797ee9a 100644 --- a/src/bo4e/com/adresse.py +++ b/src/bo4e/com/adresse.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import Optional +from typing import Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..enum.landescode import Landescode from ..utils import postprocess_docstring from .com import COM @@ -26,6 +29,8 @@ class Adresse(COM): """ + typ: Annotated[Literal[ComTyp.ADRESSE], Field(alias="_typ")] = ComTyp.ADRESSE + postleitzahl: Optional[str] = None """ Die Postleitzahl; z.B: "41836" diff --git a/src/bo4e/com/angebotsposition.py b/src/bo4e/com/angebotsposition.py index 67fcf5a1b..99956cc75 100644 --- a/src/bo4e/com/angebotsposition.py +++ b/src/bo4e/com/angebotsposition.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -35,6 +38,8 @@ class Angebotsposition(COM): """ + typ: Annotated[Literal[ComTyp.ANGEBOTSPOSITION], Field(alias="_typ")] = ComTyp.ANGEBOTSPOSITION + positionsbezeichnung: Optional[str] = None """Bezeichnung der jeweiligen Position des Angebotsteils""" positionspreis: Optional["Preis"] = None diff --git a/src/bo4e/com/angebotsteil.py b/src/bo4e/com/angebotsteil.py index 2a0649506..6dad134b1 100644 --- a/src/bo4e/com/angebotsteil.py +++ b/src/bo4e/com/angebotsteil.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -37,6 +40,8 @@ class Angebotsteil(COM): """ + typ: Annotated[Literal[ComTyp.ANGEBOTSTEIL], Field(alias="_typ")] = ComTyp.ANGEBOTSTEIL + positionen: Optional[list["Angebotsposition"]] = None """Einzelne Positionen, die zu diesem Angebotsteil gehören""" diff --git a/src/bo4e/com/angebotsvariante.py b/src/bo4e/com/angebotsvariante.py index 90505df34..2ee307b70 100644 --- a/src/bo4e/com/angebotsvariante.py +++ b/src/bo4e/com/angebotsvariante.py @@ -4,10 +4,12 @@ # pylint: disable=too-few-public-methods # pylint: disable=no-name-in-module -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional import pydantic +from pydantic import Field +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -32,6 +34,8 @@ class Angebotsvariante(COM): """ + typ: Annotated[Literal[ComTyp.ANGEBOTSVARIANTE], Field(alias="_typ")] = ComTyp.ANGEBOTSVARIANTE + angebotsstatus: Optional["Angebotsstatus"] = None """Gibt den Status eines Angebotes an.""" diff --git a/src/bo4e/com/aufabschlag.py b/src/bo4e/com/aufabschlag.py index 2187164f0..8e087cbe8 100644 --- a/src/bo4e/com/aufabschlag.py +++ b/src/bo4e/com/aufabschlag.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -33,6 +36,8 @@ class AufAbschlag(COM): """ + typ: Annotated[Literal[ComTyp.AUFABSCHLAG], Field(alias="_typ")] = ComTyp.AUFABSCHLAG + bezeichnung: Optional[str] = None """Bezeichnung des Auf-/Abschlags""" staffeln: Optional[list["Preisstaffel"]] = None diff --git a/src/bo4e/com/aufabschlagproort.py b/src/bo4e/com/aufabschlagproort.py index 632140286..6b9d37ce8 100644 --- a/src/bo4e/com/aufabschlagproort.py +++ b/src/bo4e/com/aufabschlagproort.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -32,6 +35,8 @@ class AufAbschlagProOrt(COM): """ + typ: Annotated[Literal[ComTyp.AUFABSCHLAGPROORT], Field(alias="_typ")] = ComTyp.AUFABSCHLAGPROORT + postleitzahl: Optional[str] = None """Die Postleitzahl des Ortes für den der Aufschlag gilt.""" ort: Optional[str] = None diff --git a/src/bo4e/com/aufabschlagregional.py b/src/bo4e/com/aufabschlagregional.py index 3511acaf1..101bd8767 100644 --- a/src/bo4e/com/aufabschlagregional.py +++ b/src/bo4e/com/aufabschlagregional.py @@ -2,8 +2,11 @@ Contains AufAbschlagRegional and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring # pylint: disable=R0801 @@ -41,6 +44,7 @@ class AufAbschlagRegional(COM): """ + typ: Annotated[Literal[ComTyp.AUFABSCHLAGREGIONAL], Field(alias="_typ")] = ComTyp.AUFABSCHLAGREGIONAL # required attributess bezeichnung: Optional[str] = None """Bezeichnung des Auf-/Abschlags""" diff --git a/src/bo4e/com/aufabschlagstaffelproort.py b/src/bo4e/com/aufabschlagstaffelproort.py index dedb7854d..bbfbd65f5 100644 --- a/src/bo4e/com/aufabschlagstaffelproort.py +++ b/src/bo4e/com/aufabschlagstaffelproort.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import Optional +from typing import Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -26,6 +29,8 @@ class AufAbschlagstaffelProOrt(COM): """ + typ: Annotated[Literal[ComTyp.AUFABSCHLAGSTAFFELPROORT], Field(alias="_typ")] = ComTyp.AUFABSCHLAGSTAFFELPROORT + wert: Optional[Decimal] = None """Der Wert für den Auf- oder Abschlag.""" staffelgrenze_von: Optional[Decimal] = None diff --git a/src/bo4e/com/ausschreibungsdetail.py b/src/bo4e/com/ausschreibungsdetail.py index 3f158c41e..78219fbc2 100644 --- a/src/bo4e/com/ausschreibungsdetail.py +++ b/src/bo4e/com/ausschreibungsdetail.py @@ -2,8 +2,11 @@ Contains class Ausschreibungsdetail and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -31,6 +34,8 @@ class Ausschreibungsdetail(COM): """ + typ: Annotated[Literal[ComTyp.AUSSCHREIBUNGSDETAIL], Field(alias="_typ")] = ComTyp.AUSSCHREIBUNGSDETAIL + marktlokations_id: Optional[str] = None """Identifikation einer ausgeschriebenen Marktlokation""" netzebene_lieferung: Optional[str] = None diff --git a/src/bo4e/com/ausschreibungslos.py b/src/bo4e/com/ausschreibungslos.py index 8e700ca4b..8d2736160 100644 --- a/src/bo4e/com/ausschreibungslos.py +++ b/src/bo4e/com/ausschreibungslos.py @@ -4,8 +4,11 @@ # pylint: disable=too-few-public-methods, too-many-instance-attributes # pylint: disable=no-name-in-module -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -33,6 +36,8 @@ class Ausschreibungslos(COM): """ + typ: Annotated[Literal[ComTyp.AUSSCHREIBUNGSLOS], Field(alias="_typ")] = ComTyp.AUSSCHREIBUNGSLOS + losnummer: Optional[str] = None """Laufende Nummer des Loses""" bezeichnung: Optional[str] = None diff --git a/src/bo4e/com/betrag.py b/src/bo4e/com/betrag.py index 6bd2eb4ab..2473c98ae 100644 --- a/src/bo4e/com/betrag.py +++ b/src/bo4e/com/betrag.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -31,6 +34,8 @@ class Betrag(COM): """ + typ: Annotated[Literal[ComTyp.BETRAG], Field(alias="_typ")] = ComTyp.BETRAG + wert: Optional[Decimal] = None """Gibt den Betrag des Preises an.""" waehrung: Optional["Waehrungscode"] = None diff --git a/src/bo4e/com/dienstleistung.py b/src/bo4e/com/dienstleistung.py index a91286744..41e6f5304 100644 --- a/src/bo4e/com/dienstleistung.py +++ b/src/bo4e/com/dienstleistung.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -29,6 +32,8 @@ class Dienstleistung(COM): """ + typ: Annotated[Literal[ComTyp.DIENSTLEISTUNG], Field(alias="_typ")] = ComTyp.DIENSTLEISTUNG + dienstleistungstyp: Optional["Dienstleistungstyp"] = None """Kennzeichnung der Dienstleistung""" bezeichnung: Optional[str] = None diff --git a/src/bo4e/com/energieherkunft.py b/src/bo4e/com/energieherkunft.py index 7e14a642e..d304f6eb2 100644 --- a/src/bo4e/com/energieherkunft.py +++ b/src/bo4e/com/energieherkunft.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -33,6 +36,8 @@ class Energieherkunft(COM): """ + typ: Annotated[Literal[ComTyp.ENERGIEHERKUNFT], Field(alias="_typ")] = ComTyp.ENERGIEHERKUNFT + erzeugungsart: Optional["Erzeugungsart"] = None """Art der Erzeugung der Energie.""" anteil_prozent: Optional[Decimal] = None diff --git a/src/bo4e/com/energiemix.py b/src/bo4e/com/energiemix.py index f6ebaf8a7..b63eb029c 100644 --- a/src/bo4e/com/energiemix.py +++ b/src/bo4e/com/energiemix.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -33,6 +36,8 @@ class Energiemix(COM): """ + typ: Annotated[Literal[ComTyp.ENERGIEMIX], Field(alias="_typ")] = ComTyp.ENERGIEMIX + energiemixnummer: Optional[int] = None """Eindeutige Nummer zur Identifizierung des Energiemixes""" energieart: Optional["Sparte"] = None diff --git a/src/bo4e/com/fremdkostenblock.py b/src/bo4e/com/fremdkostenblock.py index 293ea751f..68c25ea83 100644 --- a/src/bo4e/com/fremdkostenblock.py +++ b/src/bo4e/com/fremdkostenblock.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -30,6 +33,8 @@ class Fremdkostenblock(COM): """ + typ: Annotated[Literal[ComTyp.FREMDKOSTENBLOCK], Field(alias="_typ")] = ComTyp.FREMDKOSTENBLOCK + kostenblockbezeichnung: Optional[str] = None """Bezeichnung für einen Kostenblock. Z.B. Netzkosten, Messkosten, Umlagen, etc.""" diff --git a/src/bo4e/com/fremdkostenposition.py b/src/bo4e/com/fremdkostenposition.py index 00831b80f..1aac588d0 100644 --- a/src/bo4e/com/fremdkostenposition.py +++ b/src/bo4e/com/fremdkostenposition.py @@ -2,8 +2,11 @@ Contains Fremdkostenposition and corresponding marshmallow schema for de-/serialization """ -from typing import Optional +from typing import Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .kostenposition import Kostenposition @@ -24,6 +27,8 @@ class Fremdkostenposition(Kostenposition): """ + typ: Annotated[Literal[ComTyp.FREMDKOSTENPOSITION], Field(alias="_typ")] = ComTyp.FREMDKOSTENPOSITION + # optional attributes (additional to those from Kostenposition) marktpartnername: Optional[str] = None """Der Name des Marktpartners, der die Preise festlegt, bzw. die Kosten in Rechnung stellt""" diff --git a/src/bo4e/com/geokoordinaten.py b/src/bo4e/com/geokoordinaten.py index 0dec9d9ad..ec47c4722 100644 --- a/src/bo4e/com/geokoordinaten.py +++ b/src/bo4e/com/geokoordinaten.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import Optional +from typing import Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -26,5 +29,7 @@ class Geokoordinaten(COM): """ + typ: Annotated[Literal[ComTyp.GEOKOORDINATEN], Field(alias="_typ")] = ComTyp.GEOKOORDINATEN + breitengrad: Optional[Decimal] = None laengengrad: Optional[Decimal] = None diff --git a/src/bo4e/com/katasteradresse.py b/src/bo4e/com/katasteradresse.py index 7459cbfaa..f9ef5622b 100644 --- a/src/bo4e/com/katasteradresse.py +++ b/src/bo4e/com/katasteradresse.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import Optional +from typing import Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -25,5 +28,7 @@ class Katasteradresse(COM): """ + typ: Annotated[Literal[ComTyp.KATASTERADRESSE], Field(alias="_typ")] = ComTyp.KATASTERADRESSE + gemarkung_flur: Optional[str] = None flurstueck: Optional[str] = None diff --git a/src/bo4e/com/konfigurationsprodukt.py b/src/bo4e/com/konfigurationsprodukt.py index a8701cfc5..8b8f47a63 100644 --- a/src/bo4e/com/konfigurationsprodukt.py +++ b/src/bo4e/com/konfigurationsprodukt.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -29,6 +32,8 @@ class Konfigurationsprodukt(COM): """ + typ: Annotated[Literal[ComTyp.KONFIGURATIONSPRODUKT], Field(alias="_typ")] = ComTyp.KONFIGURATIONSPRODUKT + produktcode: Optional[str] = None leistungskurvendefinition: Optional[str] = None schaltzeitdefinition: Optional[str] = None diff --git a/src/bo4e/com/kontaktweg.py b/src/bo4e/com/kontaktweg.py index 12b6d444d..f64e0e0f3 100644 --- a/src/bo4e/com/kontaktweg.py +++ b/src/bo4e/com/kontaktweg.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -29,6 +32,8 @@ class Kontaktweg(COM): """ + typ: Annotated[Literal[ComTyp.KONTAKTWEG], Field(alias="_typ")] = ComTyp.KONTAKTWEG + kontaktart: Optional["Kontaktart"] = None """Gibt die Kontaktart des Kontaktes an.""" beschreibung: Optional[str] = None diff --git a/src/bo4e/com/konzessionsabgabe.py b/src/bo4e/com/konzessionsabgabe.py index 679df6db8..3c7e937dd 100644 --- a/src/bo4e/com/konzessionsabgabe.py +++ b/src/bo4e/com/konzessionsabgabe.py @@ -3,8 +3,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -29,6 +32,8 @@ class Konzessionsabgabe(COM): """ + typ: Annotated[Literal[ComTyp.KONZESSIONSABGABE], Field(alias="_typ")] = ComTyp.KONZESSIONSABGABE + satz: Optional["AbgabeArt"] = None """Art der Abgabe""" diff --git a/src/bo4e/com/kostenblock.py b/src/bo4e/com/kostenblock.py index eeff9ce7a..07991118b 100644 --- a/src/bo4e/com/kostenblock.py +++ b/src/bo4e/com/kostenblock.py @@ -2,8 +2,11 @@ Contains Kostenblock and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -29,6 +32,8 @@ class Kostenblock(COM): """ + typ: Annotated[Literal[ComTyp.KOSTENBLOCK], Field(alias="_typ")] = ComTyp.KOSTENBLOCK + kostenblockbezeichnung: Optional[str] = None """Bezeichnung für einen Kostenblock. Z.B. Netzkosten, Messkosten, Umlagen, etc.""" diff --git a/src/bo4e/com/kostenposition.py b/src/bo4e/com/kostenposition.py index ab92eab54..c437c3adf 100644 --- a/src/bo4e/com/kostenposition.py +++ b/src/bo4e/com/kostenposition.py @@ -2,10 +2,12 @@ Contains Kostenposition and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional import pydantic +from pydantic import Field +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -32,6 +34,8 @@ class Kostenposition(COM): """ + typ: Annotated[Literal[ComTyp.KOSTENPOSITION], Field(alias="_typ")] = ComTyp.KOSTENPOSITION + positionstitel: Optional[str] = None """Ein Titel für die Zeile. Hier kann z.B. der Netzbetreiber eingetragen werden, wenn es sich um Netzkosten handelt.""" diff --git a/src/bo4e/com/kriteriumwert.py b/src/bo4e/com/kriteriumwert.py index d11eb0732..bc6bfb88b 100644 --- a/src/bo4e/com/kriteriumwert.py +++ b/src/bo4e/com/kriteriumwert.py @@ -4,8 +4,11 @@ """ # pylint: disable=too-few-public-methods -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -27,6 +30,8 @@ class KriteriumWert(COM): """ + typ: Annotated[Literal[ComTyp.KRITERIUMWERT], Field(alias="_typ")] = ComTyp.KRITERIUMWERT + kriterium: Optional["Tarifregionskriterium"] = None """Hier steht, für welches Kriterium der Wert gilt. Z.B. Postleitzahlen""" wert: Optional[str] = None diff --git a/src/bo4e/com/lastprofil.py b/src/bo4e/com/lastprofil.py index 0fd80c1f0..9771eda78 100644 --- a/src/bo4e/com/lastprofil.py +++ b/src/bo4e/com/lastprofil.py @@ -2,10 +2,13 @@ Contains class Lastprofil """ -from typing import Optional +from typing import Annotated, Literal, Optional + +from pydantic import Field from bo4e.com.com import COM from bo4e.com.tagesparameter import Tagesparameter +from bo4e.enum.comtyp import ComTyp from bo4e.enum.profilart import Profilart from bo4e.enum.profilverfahren import Profilverfahren @@ -23,6 +26,8 @@ class Lastprofil(COM): """ + typ: Annotated[Literal[ComTyp.LASTPROFIL], Field(alias="_typ")] = ComTyp.LASTPROFIL + bezeichnung: Optional[str] = None #: Bezeichnung des Profils, durch DVGW bzw. den Netzbetreiber vergeben (z.B. H0) profilschar: Optional[str] = ( None #: Bezeichnung der Profilschar, durch DVGW bzw. den Netzbetreiber vergeben (z.B. H0) diff --git a/src/bo4e/com/marktgebietinfo.py b/src/bo4e/com/marktgebietinfo.py index 1dcf43dbf..798de9064 100644 --- a/src/bo4e/com/marktgebietinfo.py +++ b/src/bo4e/com/marktgebietinfo.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import Optional +from typing import Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -25,6 +28,8 @@ class MarktgebietInfo(COM): """ + typ: Annotated[Literal[ComTyp.MARKTGEBIETINFO], Field(alias="_typ")] = ComTyp.MARKTGEBIETINFO + marktgebiet: Optional[str] = None """Der Name des Marktgebietes""" marktgebietcode: Optional[str] = None diff --git a/src/bo4e/com/menge.py b/src/bo4e/com/menge.py index 1d30574e9..2d478a986 100644 --- a/src/bo4e/com/menge.py +++ b/src/bo4e/com/menge.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -30,6 +33,8 @@ class Menge(COM): """ + typ: Annotated[Literal[ComTyp.MENGE], Field(alias="_typ")] = ComTyp.MENGE + wert: Optional[Decimal] = None """Gibt den absoluten Wert der Menge an""" einheit: Optional["Mengeneinheit"] = None diff --git a/src/bo4e/com/positionsaufabschlag.py b/src/bo4e/com/positionsaufabschlag.py index a58e53f92..f97f0396e 100644 --- a/src/bo4e/com/positionsaufabschlag.py +++ b/src/bo4e/com/positionsaufabschlag.py @@ -5,8 +5,11 @@ from decimal import Decimal # pylint: disable=too-few-public-methods -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -32,6 +35,8 @@ class PositionsAufAbschlag(COM): """ + typ: Annotated[Literal[ComTyp.POSITIONSAUFABSCHLAG], Field(alias="_typ")] = ComTyp.POSITIONSAUFABSCHLAG + bezeichnung: Optional[str] = None """Bezeichnung des Auf-/Abschlags""" beschreibung: Optional[str] = None diff --git a/src/bo4e/com/preis.py b/src/bo4e/com/preis.py index 0474149c4..e9dfdc9e8 100644 --- a/src/bo4e/com/preis.py +++ b/src/bo4e/com/preis.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -32,6 +35,7 @@ class Preis(COM): """ + typ: Annotated[Literal[ComTyp.PREIS], Field(alias="_typ")] = ComTyp.PREIS wert: Optional[Decimal] = None """Gibt die nominale Höhe des Preises an.""" einheit: Optional["Waehrungseinheit"] = None diff --git a/src/bo4e/com/preisgarantie.py b/src/bo4e/com/preisgarantie.py index baf82e15b..79b752190 100644 --- a/src/bo4e/com/preisgarantie.py +++ b/src/bo4e/com/preisgarantie.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -29,6 +32,8 @@ class Preisgarantie(COM): """ + typ: Annotated[Literal[ComTyp.PREISGARANTIE], Field(alias="_typ")] = ComTyp.PREISGARANTIE + preisgarantietyp: Optional["Preisgarantietyp"] = None """Festlegung, auf welche Preisbestandteile die Garantie gewährt wird.""" zeitliche_gueltigkeit: Optional["Zeitraum"] = None diff --git a/src/bo4e/com/preisposition.py b/src/bo4e/com/preisposition.py index 824950a1f..726f4eba6 100644 --- a/src/bo4e/com/preisposition.py +++ b/src/bo4e/com/preisposition.py @@ -5,8 +5,11 @@ from decimal import Decimal # pylint: disable=no-name-in-module -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -37,6 +40,8 @@ class Preisposition(COM): """ + typ: Annotated[Literal[ComTyp.PREISPOSITION], Field(alias="_typ")] = ComTyp.PREISPOSITION + berechnungsmethode: Optional["Kalkulationsmethode"] = None """Das Modell, das der Preisbildung zugrunde liegt""" leistungstyp: Optional["Leistungstyp"] = None diff --git a/src/bo4e/com/preisstaffel.py b/src/bo4e/com/preisstaffel.py index 4ba539fa2..9c6d5c0a2 100644 --- a/src/bo4e/com/preisstaffel.py +++ b/src/bo4e/com/preisstaffel.py @@ -3,8 +3,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -29,6 +32,8 @@ class Preisstaffel(COM): """ + typ: Annotated[Literal[ComTyp.PREISSTAFFEL], Field(alias="_typ")] = ComTyp.PREISSTAFFEL + einheitspreis: Optional[Decimal] = None """Preis pro abgerechneter Mengeneinheit""" staffelgrenze_von: Optional[Decimal] = None diff --git a/src/bo4e/com/rechnungsposition.py b/src/bo4e/com/rechnungsposition.py index 33f79981d..af7b90aa7 100644 --- a/src/bo4e/com/rechnungsposition.py +++ b/src/bo4e/com/rechnungsposition.py @@ -3,10 +3,12 @@ """ # pylint: disable=too-few-public-methods, too-many-instance-attributes -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional import pydantic +from pydantic import Field +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -34,6 +36,8 @@ class Rechnungsposition(COM): """ + typ: Annotated[Literal[ComTyp.RECHNUNGSPOSITION], Field(alias="_typ")] = ComTyp.RECHNUNGSPOSITION + positionsnummer: Optional[int] = None """Fortlaufende Nummer für die Rechnungsposition""" diff --git a/src/bo4e/com/regionalegueltigkeit.py b/src/bo4e/com/regionalegueltigkeit.py index d54005afd..118ca0a3f 100644 --- a/src/bo4e/com/regionalegueltigkeit.py +++ b/src/bo4e/com/regionalegueltigkeit.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -30,6 +33,8 @@ class RegionaleGueltigkeit(COM): """ + typ: Annotated[Literal[ComTyp.REGIONALEGUELTIGKEIT], Field(alias="_typ")] = ComTyp.REGIONALEGUELTIGKEIT + gueltigkeitstyp: Optional["Gueltigkeitstyp"] = None """Unterscheidung ob Positivliste oder Negativliste übertragen wird""" kriteriums_werte: Optional[list["KriteriumWert"]] = None diff --git a/src/bo4e/com/regionalepreisgarantie.py b/src/bo4e/com/regionalepreisgarantie.py index 3262752b8..7ec00ae1b 100644 --- a/src/bo4e/com/regionalepreisgarantie.py +++ b/src/bo4e/com/regionalepreisgarantie.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .preisgarantie import Preisgarantie @@ -28,5 +31,7 @@ class RegionalePreisgarantie(Preisgarantie): """ + typ: Annotated[Literal[ComTyp.REGIONALERPREISGARANTIE], Field(alias="_typ")] = ComTyp.REGIONALERPREISGARANTIE + regionale_gueltigkeit: Optional["RegionaleGueltigkeit"] = None """Regionale Eingrenzung der Preisgarantie.""" diff --git a/src/bo4e/com/regionalepreisstaffel.py b/src/bo4e/com/regionalepreisstaffel.py index 46cc7d24d..7b9c64f49 100644 --- a/src/bo4e/com/regionalepreisstaffel.py +++ b/src/bo4e/com/regionalepreisstaffel.py @@ -2,8 +2,11 @@ Contains RegionalePreisstaffel class and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .preisstaffel import Preisstaffel @@ -27,5 +30,7 @@ class RegionalePreisstaffel(Preisstaffel): """ + typ: Annotated[Literal[ComTyp.REGIONALERPREISSTAFFEL], Field(alias="_typ")] = ComTyp.REGIONALERPREISSTAFFEL + regionale_gueltigkeit: Optional["RegionaleGueltigkeit"] = None """Regionale Eingrenzung der Preisstaffel""" diff --git a/src/bo4e/com/regionaleraufabschlag.py b/src/bo4e/com/regionaleraufabschlag.py index b17d19ff7..1fe1f0d53 100644 --- a/src/bo4e/com/regionaleraufabschlag.py +++ b/src/bo4e/com/regionaleraufabschlag.py @@ -2,7 +2,11 @@ Contains RegionalerAufAbschlag class and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional + +from pydantic import Field + +from ..enum.comtyp import ComTyp # pylint: disable=R0801 from ..utils import postprocess_docstring @@ -40,6 +44,8 @@ class RegionalerAufAbschlag(COM): """ + typ: Annotated[Literal[ComTyp.REGIONALERAUFABSCHLAG], Field(alias="_typ")] = ComTyp.REGIONALERAUFABSCHLAG + bezeichnung: Optional[str] = None """Bezeichnung des Auf-/Abschlags""" diff --git a/src/bo4e/com/regionaletarifpreisposition.py b/src/bo4e/com/regionaletarifpreisposition.py index cc0733437..7233adf0b 100644 --- a/src/bo4e/com/regionaletarifpreisposition.py +++ b/src/bo4e/com/regionaletarifpreisposition.py @@ -4,8 +4,11 @@ # pylint: disable=too-few-public-methods # pylint: disable=no-name-in-module -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -31,6 +34,10 @@ class RegionaleTarifpreisposition(COM): """ + typ: Annotated[Literal[ComTyp.REGIONALERTARIFPREISPOSITION], Field(alias="_typ")] = ( + ComTyp.REGIONALERTARIFPREISPOSITION + ) + preistyp: Optional["Preistyp"] = None """Angabe des Preistypes (z.B. Grundpreis)""" einheit: Optional["Waehrungseinheit"] = None diff --git a/src/bo4e/com/regionskriterium.py b/src/bo4e/com/regionskriterium.py index c400b18b5..cfd4437e7 100644 --- a/src/bo4e/com/regionskriterium.py +++ b/src/bo4e/com/regionskriterium.py @@ -2,8 +2,11 @@ Contains Regionskriterium class and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -29,6 +32,8 @@ class Regionskriterium(COM): """ + typ: Annotated[Literal[ComTyp.REGIONSKRITERIUM], Field(alias="_typ")] = ComTyp.REGIONSKRITERIUM + gueltigkeitstyp: Optional["Gueltigkeitstyp"] = None """Hier wird festgelegt, ob es sich um ein einschließendes oder ausschließendes Kriterium handelt.""" regionskriteriumtyp: Optional["Regionskriteriumtyp"] = None diff --git a/src/bo4e/com/sigmoidparameter.py b/src/bo4e/com/sigmoidparameter.py index e22101b37..399b16e63 100644 --- a/src/bo4e/com/sigmoidparameter.py +++ b/src/bo4e/com/sigmoidparameter.py @@ -3,8 +3,11 @@ """ from decimal import Decimal -from typing import Optional +from typing import Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -26,6 +29,8 @@ class Sigmoidparameter(COM): """ + typ: Annotated[Literal[ComTyp.SIGMOIDPARAMETER], Field(alias="_typ")] = ComTyp.SIGMOIDPARAMETER + A: Optional[Decimal] = None """Briefmarke Ortsverteilnetz (EUR/kWh)""" B: Optional[Decimal] = None diff --git a/src/bo4e/com/standorteigenschaftengas.py b/src/bo4e/com/standorteigenschaftengas.py index bf8b2ec32..cccbc13fc 100644 --- a/src/bo4e/com/standorteigenschaftengas.py +++ b/src/bo4e/com/standorteigenschaftengas.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -30,6 +33,7 @@ class StandorteigenschaftenGas(COM): """ + typ: Annotated[Literal[ComTyp.STANDORTEIGENSCHAFTENGAS], Field(alias="_typ")] = ComTyp.STANDORTEIGENSCHAFTENGAS netzkontonummern: Optional[list[str]] = None """Netzkontonummern der Gasnetze""" marktgebiete: Optional[list["MarktgebietInfo"]] = None diff --git a/src/bo4e/com/standorteigenschaftenstrom.py b/src/bo4e/com/standorteigenschaftenstrom.py index a871cf891..a588b062b 100644 --- a/src/bo4e/com/standorteigenschaftenstrom.py +++ b/src/bo4e/com/standorteigenschaftenstrom.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import Optional +from typing import Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -25,6 +28,7 @@ class StandorteigenschaftenStrom(COM): """ + typ: Annotated[Literal[ComTyp.STANDORTEIGENSCHAFTENSTROM], Field(alias="_typ")] = ComTyp.STANDORTEIGENSCHAFTENSTROM bilanzierungsgebiet_eic: Optional[str] = None """Die EIC-Nummer des Bilanzierungsgebietes""" # todo: use EIC validation: https://github.com/Hochfrequenz/BO4E-python/issues/147 diff --git a/src/bo4e/com/steuerbetrag.py b/src/bo4e/com/steuerbetrag.py index 40d316396..04510a81f 100644 --- a/src/bo4e/com/steuerbetrag.py +++ b/src/bo4e/com/steuerbetrag.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -31,6 +34,8 @@ class Steuerbetrag(COM): """ + typ: Annotated[Literal[ComTyp.STEUERBETRAG], Field(alias="_typ")] = ComTyp.STEUERBETRAG + steuerkennzeichen: Optional["Steuerkennzeichen"] = None """Kennzeichnung des Steuersatzes, bzw. Verfahrens.""" basiswert: Optional[Decimal] = None diff --git a/src/bo4e/com/tagesparameter.py b/src/bo4e/com/tagesparameter.py index f76793d30..95c6db601 100644 --- a/src/bo4e/com/tagesparameter.py +++ b/src/bo4e/com/tagesparameter.py @@ -2,10 +2,14 @@ Contains tagesparameter class """ -from typing import Optional +from typing import Annotated, Literal, Optional + +from pydantic import Field from bo4e.com.com import COM +from ..enum.comtyp import ComTyp + class Tagesparameter(COM): """ @@ -13,6 +17,8 @@ class Tagesparameter(COM): der Wetterstation für die Temperaturmessstelle """ + typ: Annotated[Literal[ComTyp.TAGESPARAMETER], Field(alias="_typ")] = ComTyp.TAGESPARAMETER + klimazone: Optional[str] = None #: Qualifier der Klimazone, e.g. 7624q temperaturmessstelle: Optional[str] = None #: Qualifier der Temperaturmessstelle, e.g. 1234x dienstanbieter: Optional[str] = None #: Dienstanbieter (bei Temperaturmessstellen), e.g. ZT1 diff --git a/src/bo4e/com/tarifberechnungsparameter.py b/src/bo4e/com/tarifberechnungsparameter.py index aaefbc8ed..305e2e547 100644 --- a/src/bo4e/com/tarifberechnungsparameter.py +++ b/src/bo4e/com/tarifberechnungsparameter.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -35,7 +38,7 @@ class Tarifberechnungsparameter(COM): """ - # there are no required attributes + typ: Annotated[Literal[ComTyp.TARIFBERECHNUNGSPARAMETER], Field(alias="_typ")] = ComTyp.TARIFBERECHNUNGSPARAMETER berechnungsmethode: Optional["Tarifkalkulationsmethode"] = None """Gibt an, wie die Einzelpreise des Tarifes zu verarbeiten sind""" diff --git a/src/bo4e/com/tarifeinschraenkung.py b/src/bo4e/com/tarifeinschraenkung.py index f44740313..3de2db0d0 100644 --- a/src/bo4e/com/tarifeinschraenkung.py +++ b/src/bo4e/com/tarifeinschraenkung.py @@ -2,8 +2,11 @@ Contains Tarifeinschraenkung and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -29,6 +32,8 @@ class Tarifeinschraenkung(COM): """ + typ: Annotated[Literal[ComTyp.TARIFEINSCHRAENKUNG], Field(alias="_typ")] = ComTyp.TARIFEINSCHRAENKUNG + zusatzprodukte: Optional[list[str]] = None """Weitere Produkte, die gemeinsam mit diesem Tarif bestellt werden können""" voraussetzungen: Optional[list["Voraussetzungen"]] = None diff --git a/src/bo4e/com/tarifpreis.py b/src/bo4e/com/tarifpreis.py index be8e7d4bb..e0f345a27 100644 --- a/src/bo4e/com/tarifpreis.py +++ b/src/bo4e/com/tarifpreis.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .preis import Preis @@ -29,6 +32,8 @@ class Tarifpreis(Preis): """ + typ: Annotated[Literal[ComTyp.TARIFPREIS], Field(alias="_typ")] = ComTyp.TARIFPREIS + preistyp: Optional["Preistyp"] = None """ Angabe des Preistypes (z.B. Grundpreis)""" diff --git a/src/bo4e/com/tarifpreisposition.py b/src/bo4e/com/tarifpreisposition.py index 780610df7..bca4f24f8 100644 --- a/src/bo4e/com/tarifpreisposition.py +++ b/src/bo4e/com/tarifpreisposition.py @@ -5,8 +5,11 @@ # pylint: disable=too-few-public-methods # pylint: disable=no-name-in-module -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -31,6 +34,8 @@ class Tarifpreisposition(COM): """ + typ: Annotated[Literal[ComTyp.TARIFPREISPOSITION], Field(alias="_typ")] = ComTyp.TARIFPREISPOSITION + preistyp: Optional["Preistyp"] = None """Angabe des Preistypes (z.B. Grundpreis)""" einheit: Optional["Waehrungseinheit"] = None diff --git a/src/bo4e/com/tarifpreispositionproort.py b/src/bo4e/com/tarifpreispositionproort.py index 8291a96ea..e48459ee4 100644 --- a/src/bo4e/com/tarifpreispositionproort.py +++ b/src/bo4e/com/tarifpreispositionproort.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -30,6 +33,8 @@ class TarifpreispositionProOrt(COM): """ + typ: Annotated[Literal[ComTyp.TARIFPREISPOSITIONPROORT], Field(alias="_typ")] = ComTyp.TARIFPREISPOSITIONPROORT + postleitzahl: Optional[str] = None """Postleitzahl des Ortes für den der Preis gilt""" ort: Optional[str] = None diff --git a/src/bo4e/com/tarifpreisstaffelproort.py b/src/bo4e/com/tarifpreisstaffelproort.py index 9335e6a71..14631abb2 100644 --- a/src/bo4e/com/tarifpreisstaffelproort.py +++ b/src/bo4e/com/tarifpreisstaffelproort.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import Optional +from typing import Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -26,6 +29,8 @@ class TarifpreisstaffelProOrt(COM): """ + typ: Annotated[Literal[ComTyp.TARIFPREISSTAFFELPROORT], Field(alias="_typ")] = ComTyp.TARIFPREISSTAFFELPROORT + # todo: decimal doesn't make sense here imo # https://github.com/Hochfrequenz/BO4E-python/issues/344 diff --git a/src/bo4e/com/unterschrift.py b/src/bo4e/com/unterschrift.py index 073d67cc8..6dec56a7f 100644 --- a/src/bo4e/com/unterschrift.py +++ b/src/bo4e/com/unterschrift.py @@ -3,10 +3,12 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import Optional +from typing import Annotated, Literal, Optional import pydantic +from pydantic import Field +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -27,6 +29,8 @@ class Unterschrift(COM): """ + typ: Annotated[Literal[ComTyp.UNTERSCHRIFT], Field(alias="_typ")] = ComTyp.UNTERSCHRIFT + name: Optional[str] = None """Name des Unterschreibers""" diff --git a/src/bo4e/com/verbrauch.py b/src/bo4e/com/verbrauch.py index 6c6c8aac5..f8f747e15 100644 --- a/src/bo4e/com/verbrauch.py +++ b/src/bo4e/com/verbrauch.py @@ -3,10 +3,12 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional import pydantic +from pydantic import Field +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -34,6 +36,8 @@ class Verbrauch(COM): """ + typ: Annotated[Literal[ComTyp.VERBRAUCH], Field(alias="_typ")] = ComTyp.VERBRAUCH + wertermittlungsverfahren: Optional["Wertermittlungsverfahren"] = None """Gibt an, ob es sich um eine PROGNOSE oder eine MESSUNG handelt""" obis_kennzahl: Optional[str] = None diff --git a/src/bo4e/com/vertragskonditionen.py b/src/bo4e/com/vertragskonditionen.py index 9f9284e09..75dc2153a 100644 --- a/src/bo4e/com/vertragskonditionen.py +++ b/src/bo4e/com/vertragskonditionen.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -30,6 +33,8 @@ class Vertragskonditionen(COM): """ + typ: Annotated[Literal[ComTyp.VERTRAGSKONDITIONEN], Field(alias="_typ")] = ComTyp.VERTRAGSKONDITIONEN + beschreibung: Optional[str] = None """ Freitext zur Beschreibung der Konditionen, z.B. "Standardkonditionen Gas" diff --git a/src/bo4e/com/vertragsteil.py b/src/bo4e/com/vertragsteil.py index b099ae7d3..f5c2523cf 100644 --- a/src/bo4e/com/vertragsteil.py +++ b/src/bo4e/com/vertragsteil.py @@ -3,10 +3,12 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional import pydantic +from pydantic import Field +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -32,6 +34,8 @@ class Vertragsteil(COM): """ + typ: Annotated[Literal[ComTyp.VERTRAGSTEIL], Field(alias="_typ")] = ComTyp.VERTRAGSTEIL + vertragsteilbeginn: Optional[pydantic.AwareDatetime] = None """ Start der Gültigkeit des Vertragsteils (inklusiv) diff --git a/src/bo4e/com/verwendungszweckpromarktrolle.py b/src/bo4e/com/verwendungszweckpromarktrolle.py index 9e848c5d3..a4ab7256f 100644 --- a/src/bo4e/com/verwendungszweckpromarktrolle.py +++ b/src/bo4e/com/verwendungszweckpromarktrolle.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -30,6 +33,10 @@ class VerwendungszweckProMarktrolle(COM): """ + typ: Annotated[Literal[ComTyp.VERWENDUNGSZWECKPROMARKTROLLE], Field(alias="_typ")] = ( + ComTyp.VERWENDUNGSZWECKPROMARKTROLLE + ) + marktrolle: Optional["Marktrolle"] = None """ Marktrolle, für die die Daten relevant sind diff --git a/src/bo4e/com/zaehlwerk.py b/src/bo4e/com/zaehlwerk.py index 9fd170fa9..1f688f557 100644 --- a/src/bo4e/com/zaehlwerk.py +++ b/src/bo4e/com/zaehlwerk.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -33,6 +36,8 @@ class Zaehlwerk(COM): """ + typ: Annotated[Literal[ComTyp.ZAEHLWERK], Field(alias="_typ")] = ComTyp.ZAEHLWERK + zaehlwerk_id: Optional[str] = None """ Identifikation des Zählwerks (Registers) innerhalb des Zählers. diff --git a/src/bo4e/com/zaehlzeitregister.py b/src/bo4e/com/zaehlzeitregister.py index 5267da74d..eeebca726 100644 --- a/src/bo4e/com/zaehlzeitregister.py +++ b/src/bo4e/com/zaehlzeitregister.py @@ -2,8 +2,11 @@ Contains Zaehlzeitregister class and corresponding marshmallow schema for de-/serialization """ -from typing import Optional +from typing import Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -26,9 +29,11 @@ class Zaehlzeitregister(COM): """ + typ: Annotated[Literal[ComTyp.ZAEHLZEITREGISTER], Field(alias="_typ")] = ComTyp.ZAEHLZEITREGISTER + zaehlzeit_definition: Optional[str] = None """Zählzeitdefinition""" zaehlzeit_register: Optional[str] = None - """Zählzeitregister""" + """ZählzeitRegister""" ist_schwachlastfaehig: Optional[bool] = None """Schwachlastfaehigkeit""" diff --git a/src/bo4e/com/zeitraum.py b/src/bo4e/com/zeitraum.py index 3495c5157..e7cab2bb1 100644 --- a/src/bo4e/com/zeitraum.py +++ b/src/bo4e/com/zeitraum.py @@ -4,8 +4,11 @@ """ from datetime import date, time -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -32,6 +35,8 @@ class Zeitraum(COM): """ + typ: Annotated[Literal[ComTyp.ZEITRAUM], Field(alias="_typ")] = ComTyp.ZEITRAUM + startdatum: Optional[date] = None """Startdatum, inklusiv""" enddatum: Optional[date] = None diff --git a/src/bo4e/com/zeitreihenwert.py b/src/bo4e/com/zeitreihenwert.py index 989ecb86e..c99add875 100644 --- a/src/bo4e/com/zeitreihenwert.py +++ b/src/bo4e/com/zeitreihenwert.py @@ -4,8 +4,11 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -30,6 +33,8 @@ class Zeitreihenwert(COM): """ + typ: Annotated[Literal[ComTyp.ZEITREIHEWERT], Field(alias="_typ")] = ComTyp.ZEITREIHEWERT + zeitraum: Optional["Zeitraum"] = None """Zeitraum für das Messintervall""" wert: Optional[Decimal] = None diff --git a/src/bo4e/com/zustaendigkeit.py b/src/bo4e/com/zustaendigkeit.py index fb836ef29..a9002347b 100644 --- a/src/bo4e/com/zustaendigkeit.py +++ b/src/bo4e/com/zustaendigkeit.py @@ -3,8 +3,11 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional +from pydantic import Field + +from ..enum.comtyp import ComTyp from ..utils import postprocess_docstring from .com import COM @@ -29,6 +32,7 @@ class Zustaendigkeit(COM): """ + typ: Annotated[Literal[ComTyp.ZUSTAENDIGKEIT], Field(alias="_typ")] = ComTyp.ZUSTAENDIGKEIT themengebiet: Optional["Themengebiet"] = None """ Hier kann eine thematische Zuordnung des Ansprechpartners bzw. der Person angegeben werden From 425147f199d4c20e74eb6ea66ec40004d1773f3f Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 16:44:11 +0100 Subject: [PATCH 12/26] add test to check default typ --- tests/serialization_helper.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/serialization_helper.py b/tests/serialization_helper.py index c106620bf..1e4d23508 100644 --- a/tests/serialization_helper.py +++ b/tests/serialization_helper.py @@ -9,6 +9,9 @@ from dictdiffer import diff # type:ignore[import-not-found] from pydantic import BaseModel +from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt +from bo4e.com.com import COM + T = TypeVar("T", bound=BaseModel) @@ -34,7 +37,20 @@ def _remove_version_recursive_iter(value: dict[str, Any] | list[Any]) -> None: _remove_version_recursive_iter(v) _remove_version_recursive_iter(actual_json_dict) - # TODO: serializable_object.dict() + + # Check typ property for bo and com classes + # the default value must be the corresponding enum value of the enum classes BoTyp or ComTyp + if isinstance(serializable_object, (Geschaeftsobjekt, COM)): + assert hasattr( + serializable_object, "typ" + ), f"Missing 'typ' attribute in {serializable_object.__class__.__name__}" + assert serializable_object.typ is not None + + assert serializable_object.typ.value.lower() == serializable_object.__class__.__name__.lower(), ( + f"typ value '{serializable_object.typ.value}' does not match class name " + f"'{serializable_object.__class__.__name__}'" + ) + if expected_json_dict is not None: assert all([(k in json_string) for k in expected_json_dict.keys()]) assert actual_json_dict == expected_json_dict, ( From 7dbcf6dacceed002365c169cf2ece28b6bd14ca3 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 16:44:36 +0100 Subject: [PATCH 13/26] fix failing tests --- src/bo4e/bo/bilanzierung.py | 4 ++-- src/bo4e/com/regionalepreisgarantie.py | 2 +- src/bo4e/com/regionalepreisstaffel.py | 2 +- src/bo4e/com/regionaletarifpreisposition.py | 4 ++-- src/bo4e/com/zeitreihenwert.py | 2 +- src/bo4e/enum/comtyp.py | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/bo4e/bo/bilanzierung.py b/src/bo4e/bo/bilanzierung.py index ad9586651..0fae18da9 100644 --- a/src/bo4e/bo/bilanzierung.py +++ b/src/bo4e/bo/bilanzierung.py @@ -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): @@ -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.) diff --git a/src/bo4e/com/regionalepreisgarantie.py b/src/bo4e/com/regionalepreisgarantie.py index 7ec00ae1b..4da366f1e 100644 --- a/src/bo4e/com/regionalepreisgarantie.py +++ b/src/bo4e/com/regionalepreisgarantie.py @@ -31,7 +31,7 @@ class RegionalePreisgarantie(Preisgarantie): """ - typ: Annotated[Literal[ComTyp.REGIONALERPREISGARANTIE], Field(alias="_typ")] = ComTyp.REGIONALERPREISGARANTIE + typ: Annotated[Literal[ComTyp.REGIONALEPREISGARANTIE], Field(alias="_typ")] = ComTyp.REGIONALEPREISGARANTIE regionale_gueltigkeit: Optional["RegionaleGueltigkeit"] = None """Regionale Eingrenzung der Preisgarantie.""" diff --git a/src/bo4e/com/regionalepreisstaffel.py b/src/bo4e/com/regionalepreisstaffel.py index 7b9c64f49..64a79e5f6 100644 --- a/src/bo4e/com/regionalepreisstaffel.py +++ b/src/bo4e/com/regionalepreisstaffel.py @@ -30,7 +30,7 @@ class RegionalePreisstaffel(Preisstaffel): """ - typ: Annotated[Literal[ComTyp.REGIONALERPREISSTAFFEL], Field(alias="_typ")] = ComTyp.REGIONALERPREISSTAFFEL + typ: Annotated[Literal[ComTyp.REGIONALEPREISSTAFFEL], Field(alias="_typ")] = ComTyp.REGIONALEPREISSTAFFEL regionale_gueltigkeit: Optional["RegionaleGueltigkeit"] = None """Regionale Eingrenzung der Preisstaffel""" diff --git a/src/bo4e/com/regionaletarifpreisposition.py b/src/bo4e/com/regionaletarifpreisposition.py index 7233adf0b..7a41cce3a 100644 --- a/src/bo4e/com/regionaletarifpreisposition.py +++ b/src/bo4e/com/regionaletarifpreisposition.py @@ -34,8 +34,8 @@ class RegionaleTarifpreisposition(COM): """ - typ: Annotated[Literal[ComTyp.REGIONALERTARIFPREISPOSITION], Field(alias="_typ")] = ( - ComTyp.REGIONALERTARIFPREISPOSITION + typ: Annotated[Literal[ComTyp.REGIONALETARIFPREISPOSITION], Field(alias="_typ")] = ( + ComTyp.REGIONALETARIFPREISPOSITION ) preistyp: Optional["Preistyp"] = None diff --git a/src/bo4e/com/zeitreihenwert.py b/src/bo4e/com/zeitreihenwert.py index c99add875..bf9d7e78c 100644 --- a/src/bo4e/com/zeitreihenwert.py +++ b/src/bo4e/com/zeitreihenwert.py @@ -33,7 +33,7 @@ class Zeitreihenwert(COM): """ - typ: Annotated[Literal[ComTyp.ZEITREIHEWERT], Field(alias="_typ")] = ComTyp.ZEITREIHEWERT + typ: Annotated[Literal[ComTyp.ZEITREIHENWERT], Field(alias="_typ")] = ComTyp.ZEITREIHENWERT zeitraum: Optional["Zeitraum"] = None """Zeitraum für das Messintervall""" diff --git a/src/bo4e/enum/comtyp.py b/src/bo4e/enum/comtyp.py index 2f4d53f4f..8c44ec2b5 100644 --- a/src/bo4e/enum/comtyp.py +++ b/src/bo4e/enum/comtyp.py @@ -41,10 +41,10 @@ class ComTyp(StrEnum): PREISSTAFFEL = "PREISSTAFFEL" RECHNUNGSPOSITION = "RECHNUNGSPOSITION" REGIONALEGUELTIGKEIT = "REGIONALEGUELTIGKEIT" - REGIONALERPREISGARANTIE = "REGIONALERPREISGARANTIE" - REGIONALERPREISSTAFFEL = "REGIONALERPREISSTAFFEL" + REGIONALEPREISGARANTIE = "REGIONALEPREISGARANTIE" + REGIONALEPREISSTAFFEL = "REGIONALEPREISSTAFFEL" REGIONALERAUFABSCHLAG = "REGIONALERAUFABSCHLAG" - REGIONALERTARIFPREISPOSITION = "REGIONALERTARIFPREISPOSITION" + REGIONALETARIFPREISPOSITION = "REGIONALETARIFPREISPOSITION" REGIONSKRITERIUM = "REGIONSKRITERIUM" SIGMOIDPARAMETER = "SIGMOIDPARAMETER" STANDORTEIGENSCHAFTENGAS = "STANDORTEIGENSCHAFTENGAS" @@ -65,5 +65,5 @@ class ComTyp(StrEnum): ZAEHLWERK = "ZAEHLWERK" ZAEHLZEITREGISTER = "ZAEHLZEITREGISTER" ZEITRAUM = "ZEITRAUM" - ZEITREIHEWERT = "ZEITREIHEWERT" + ZEITREIHENWERT = "ZEITREIHENWERT" ZUSTAENDIGKEIT = "ZUSTAENDIGKEIT" From a7218d284a4a665ca54ce8985d7c27e9860010a4 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 20 Mar 2025 17:07:56 +0100 Subject: [PATCH 14/26] Fix typehint errors --- src/bo4e/com/fremdkostenposition.py | 6 ++++-- src/bo4e/com/kostenposition.py | 6 ++++-- src/bo4e/com/preis.py | 5 +++-- src/bo4e/com/preisgarantie.py | 6 ++++-- src/bo4e/com/preisstaffel.py | 6 ++++-- src/bo4e/com/regionalepreisgarantie.py | 6 ++++-- src/bo4e/com/regionalepreisstaffel.py | 15 +++++++++++---- src/bo4e/com/tarifpreis.py | 4 ++-- 8 files changed, 36 insertions(+), 18 deletions(-) diff --git a/src/bo4e/com/fremdkostenposition.py b/src/bo4e/com/fremdkostenposition.py index 1aac588d0..d4f37504f 100644 --- a/src/bo4e/com/fremdkostenposition.py +++ b/src/bo4e/com/fremdkostenposition.py @@ -2,7 +2,7 @@ Contains Fremdkostenposition and corresponding marshmallow schema for de-/serialization """ -from typing import Annotated, Literal, Optional +from typing import Annotated, Literal, Optional, Union from pydantic import Field @@ -27,7 +27,9 @@ class Fremdkostenposition(Kostenposition): """ - typ: Annotated[Literal[ComTyp.FREMDKOSTENPOSITION], Field(alias="_typ")] = ComTyp.FREMDKOSTENPOSITION + typ: Annotated[Union[Literal[ComTyp.KOSTENPOSITION], Literal[ComTyp.FREMDKOSTENPOSITION]], Field(alias="_typ")] = ( + ComTyp.FREMDKOSTENPOSITION + ) # optional attributes (additional to those from Kostenposition) marktpartnername: Optional[str] = None diff --git a/src/bo4e/com/kostenposition.py b/src/bo4e/com/kostenposition.py index c437c3adf..47821f6f7 100644 --- a/src/bo4e/com/kostenposition.py +++ b/src/bo4e/com/kostenposition.py @@ -2,7 +2,7 @@ Contains Kostenposition and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Annotated, Literal, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union import pydantic from pydantic import Field @@ -34,7 +34,9 @@ class Kostenposition(COM): """ - typ: Annotated[Literal[ComTyp.KOSTENPOSITION], Field(alias="_typ")] = ComTyp.KOSTENPOSITION + typ: Annotated[Union[Literal[ComTyp.KOSTENPOSITION], Literal[ComTyp.FREMDKOSTENPOSITION]], Field(alias="_typ")] = ( + ComTyp.KOSTENPOSITION + ) positionstitel: Optional[str] = None """Ein Titel für die Zeile. Hier kann z.B. der Netzbetreiber eingetragen werden, wenn es sich um Netzkosten handelt.""" diff --git a/src/bo4e/com/preis.py b/src/bo4e/com/preis.py index e9dfdc9e8..b0ab44e5d 100644 --- a/src/bo4e/com/preis.py +++ b/src/bo4e/com/preis.py @@ -4,7 +4,7 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Annotated, Literal, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union from pydantic import Field @@ -35,7 +35,8 @@ class Preis(COM): """ - typ: Annotated[Literal[ComTyp.PREIS], Field(alias="_typ")] = ComTyp.PREIS + typ: Annotated[Union[Literal[ComTyp.PREIS], Literal[ComTyp.TARIFPREIS]], Field(alias="_typ")] = ComTyp.PREIS + wert: Optional[Decimal] = None """Gibt die nominale Höhe des Preises an.""" einheit: Optional["Waehrungseinheit"] = None diff --git a/src/bo4e/com/preisgarantie.py b/src/bo4e/com/preisgarantie.py index 79b752190..464f3a448 100644 --- a/src/bo4e/com/preisgarantie.py +++ b/src/bo4e/com/preisgarantie.py @@ -3,7 +3,7 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Annotated, Literal, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union from pydantic import Field @@ -32,7 +32,9 @@ class Preisgarantie(COM): """ - typ: Annotated[Literal[ComTyp.PREISGARANTIE], Field(alias="_typ")] = ComTyp.PREISGARANTIE + typ: Annotated[ + Union[Literal[ComTyp.PREISGARANTIE], Literal[ComTyp.REGIONALEPREISGARANTIE]], Field(alias="_typ") + ] = ComTyp.PREISGARANTIE preisgarantietyp: Optional["Preisgarantietyp"] = None """Festlegung, auf welche Preisbestandteile die Garantie gewährt wird.""" diff --git a/src/bo4e/com/preisstaffel.py b/src/bo4e/com/preisstaffel.py index 9c6d5c0a2..e3b2cf07f 100644 --- a/src/bo4e/com/preisstaffel.py +++ b/src/bo4e/com/preisstaffel.py @@ -3,7 +3,7 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Annotated, Literal, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union from pydantic import Field @@ -32,7 +32,9 @@ class Preisstaffel(COM): """ - typ: Annotated[Literal[ComTyp.PREISSTAFFEL], Field(alias="_typ")] = ComTyp.PREISSTAFFEL + typ: Annotated[Union[Literal[ComTyp.PREISSTAFFEL], Literal[ComTyp.REGIONALEPREISSTAFFEL]], Field(alias="_typ")] = ( + ComTyp.PREISSTAFFEL + ) einheitspreis: Optional[Decimal] = None """Preis pro abgerechneter Mengeneinheit""" diff --git a/src/bo4e/com/regionalepreisgarantie.py b/src/bo4e/com/regionalepreisgarantie.py index 4da366f1e..4c5e6ba0b 100644 --- a/src/bo4e/com/regionalepreisgarantie.py +++ b/src/bo4e/com/regionalepreisgarantie.py @@ -3,7 +3,7 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Annotated, Literal, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union from pydantic import Field @@ -31,7 +31,9 @@ class RegionalePreisgarantie(Preisgarantie): """ - typ: Annotated[Literal[ComTyp.REGIONALEPREISGARANTIE], Field(alias="_typ")] = ComTyp.REGIONALEPREISGARANTIE + typ: Annotated[ + Union[Literal[ComTyp.PREISGARANTIE], Literal[ComTyp.REGIONALEPREISGARANTIE]], Field(alias="_typ") + ] = ComTyp.REGIONALEPREISGARANTIE regionale_gueltigkeit: Optional["RegionaleGueltigkeit"] = None """Regionale Eingrenzung der Preisgarantie.""" diff --git a/src/bo4e/com/regionalepreisstaffel.py b/src/bo4e/com/regionalepreisstaffel.py index 64a79e5f6..387f222f3 100644 --- a/src/bo4e/com/regionalepreisstaffel.py +++ b/src/bo4e/com/regionalepreisstaffel.py @@ -1,8 +1,8 @@ """ -Contains RegionalePreisstaffel class and corresponding marshmallow schema for de-/serialization +Contains RegionalePreisstaffel and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Annotated, Literal, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union from pydantic import Field @@ -19,7 +19,7 @@ @postprocess_docstring class RegionalePreisstaffel(Preisstaffel): """ - Abbildung einer Preisstaffel mit regionaler Abgrenzung + Mit dieser Komponente können Staffelpreise abgebildet werden, die sich auf eine Region beziehen. .. raw:: html @@ -30,7 +30,14 @@ class RegionalePreisstaffel(Preisstaffel): """ - typ: Annotated[Literal[ComTyp.REGIONALEPREISSTAFFEL], Field(alias="_typ")] = ComTyp.REGIONALEPREISSTAFFEL + typ: Annotated[Union[Literal[ComTyp.PREISSTAFFEL], Literal[ComTyp.REGIONALEPREISSTAFFEL]], Field(alias="_typ")] = ( + ComTyp.REGIONALEPREISSTAFFEL + ) regionale_gueltigkeit: Optional["RegionaleGueltigkeit"] = None """Regionale Eingrenzung der Preisstaffel""" + + postleitzahl: Optional[str] = None + """Postleitzahl der Region""" + ort: Optional[str] = None + """Ort der Region""" diff --git a/src/bo4e/com/tarifpreis.py b/src/bo4e/com/tarifpreis.py index e0f345a27..20fe0dadf 100644 --- a/src/bo4e/com/tarifpreis.py +++ b/src/bo4e/com/tarifpreis.py @@ -3,7 +3,7 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Annotated, Literal, Optional +from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union from pydantic import Field @@ -32,7 +32,7 @@ class Tarifpreis(Preis): """ - typ: Annotated[Literal[ComTyp.TARIFPREIS], Field(alias="_typ")] = ComTyp.TARIFPREIS + typ: Annotated[Union[Literal[ComTyp.PREIS], Literal[ComTyp.TARIFPREIS]], Field(alias="_typ")] = ComTyp.TARIFPREIS preistyp: Optional["Preistyp"] = None """ Angabe des Preistypes (z.B. Grundpreis)""" From c2054f59014a6a1d021ad59791534f71407c309e Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 10:57:10 +0100 Subject: [PATCH 15/26] fix regionalepreisstaffel --- src/bo4e/com/regionalepreisstaffel.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/bo4e/com/regionalepreisstaffel.py b/src/bo4e/com/regionalepreisstaffel.py index 387f222f3..1c45281fe 100644 --- a/src/bo4e/com/regionalepreisstaffel.py +++ b/src/bo4e/com/regionalepreisstaffel.py @@ -2,7 +2,7 @@ Contains RegionalePreisstaffel and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union +from typing import TYPE_CHECKING, Annotated, Literal, Optional from pydantic import Field @@ -30,14 +30,7 @@ class RegionalePreisstaffel(Preisstaffel): """ - typ: Annotated[Union[Literal[ComTyp.PREISSTAFFEL], Literal[ComTyp.REGIONALEPREISSTAFFEL]], Field(alias="_typ")] = ( - ComTyp.REGIONALEPREISSTAFFEL - ) + typ: Annotated[Literal[ComTyp.REGIONALEPREISSTAFFEL], Field(alias="_typ")] = ComTyp.REGIONALEPREISSTAFFEL regionale_gueltigkeit: Optional["RegionaleGueltigkeit"] = None """Regionale Eingrenzung der Preisstaffel""" - - postleitzahl: Optional[str] = None - """Postleitzahl der Region""" - ort: Optional[str] = None - """Ort der Region""" From 93d5c6b7e08bf5961560e9ff5cd52b5de9837a6b Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 10:58:00 +0100 Subject: [PATCH 16/26] remove Union from RegionalePreisgarantie --- src/bo4e/com/regionalepreisgarantie.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bo4e/com/regionalepreisgarantie.py b/src/bo4e/com/regionalepreisgarantie.py index 4c5e6ba0b..4da366f1e 100644 --- a/src/bo4e/com/regionalepreisgarantie.py +++ b/src/bo4e/com/regionalepreisgarantie.py @@ -3,7 +3,7 @@ and corresponding marshmallow schema for de-/serialization """ -from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union +from typing import TYPE_CHECKING, Annotated, Literal, Optional from pydantic import Field @@ -31,9 +31,7 @@ class RegionalePreisgarantie(Preisgarantie): """ - typ: Annotated[ - Union[Literal[ComTyp.PREISGARANTIE], Literal[ComTyp.REGIONALEPREISGARANTIE]], Field(alias="_typ") - ] = ComTyp.REGIONALEPREISGARANTIE + typ: Annotated[Literal[ComTyp.REGIONALEPREISGARANTIE], Field(alias="_typ")] = ComTyp.REGIONALEPREISGARANTIE regionale_gueltigkeit: Optional["RegionaleGueltigkeit"] = None """Regionale Eingrenzung der Preisgarantie.""" From e0ca29376776be195ee8659dc2aa8c316183b380 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 11:02:54 +0100 Subject: [PATCH 17/26] remove union in fremdkostenposition --- src/bo4e/com/fremdkostenposition.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/bo4e/com/fremdkostenposition.py b/src/bo4e/com/fremdkostenposition.py index 60e426c22..17577ddb4 100644 --- a/src/bo4e/com/fremdkostenposition.py +++ b/src/bo4e/com/fremdkostenposition.py @@ -27,9 +27,7 @@ class Fremdkostenposition(Kostenposition): """ - typ: Annotated[Union[Literal[ComTyp.KOSTENPOSITION], Literal[ComTyp.FREMDKOSTENPOSITION]], Field(alias="_typ")] = ( - ComTyp.FREMDKOSTENPOSITION - ) + typ: Annotated[Literal[ComTyp.FREMDKOSTENPOSITION], Field(alias="_typ")] = ComTyp.FREMDKOSTENPOSITION # optional attributes (additional to those from Kostenposition) marktpartnername: Optional[str] = None From 234703b2fbc45c29a12281acde7dcaff3abe9a5f Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 11:03:31 +0100 Subject: [PATCH 18/26] remove unused imports --- src/bo4e/com/fremdkostenposition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bo4e/com/fremdkostenposition.py b/src/bo4e/com/fremdkostenposition.py index 17577ddb4..aef9c42c7 100644 --- a/src/bo4e/com/fremdkostenposition.py +++ b/src/bo4e/com/fremdkostenposition.py @@ -2,7 +2,7 @@ Contains Fremdkostenposition """ -from typing import Annotated, Literal, Optional, Union +from typing import Annotated, Literal, Optional from pydantic import Field From 85ea0b4f831a43290fd717d758675566f903bd01 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 11:10:43 +0100 Subject: [PATCH 19/26] fix kostenposition --- src/bo4e/com/fremdkostenposition.py | 4 +++- src/bo4e/com/kostenposition.py | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bo4e/com/fremdkostenposition.py b/src/bo4e/com/fremdkostenposition.py index aef9c42c7..6d050ebd6 100644 --- a/src/bo4e/com/fremdkostenposition.py +++ b/src/bo4e/com/fremdkostenposition.py @@ -27,7 +27,9 @@ class Fremdkostenposition(Kostenposition): """ - typ: Annotated[Literal[ComTyp.FREMDKOSTENPOSITION], Field(alias="_typ")] = ComTyp.FREMDKOSTENPOSITION + typ: Annotated[Literal[ComTyp.FREMDKOSTENPOSITION], Field(alias="_typ")] = ( + ComTyp.FREMDKOSTENPOSITION # type:ignore[assignment] + ) # optional attributes (additional to those from Kostenposition) marktpartnername: Optional[str] = None diff --git a/src/bo4e/com/kostenposition.py b/src/bo4e/com/kostenposition.py index 8144254da..8db5154e9 100644 --- a/src/bo4e/com/kostenposition.py +++ b/src/bo4e/com/kostenposition.py @@ -34,9 +34,7 @@ class Kostenposition(COM): """ - typ: Annotated[Union[Literal[ComTyp.KOSTENPOSITION], Literal[ComTyp.FREMDKOSTENPOSITION]], Field(alias="_typ")] = ( - ComTyp.KOSTENPOSITION - ) + typ: Annotated[Literal[ComTyp.KOSTENPOSITION], Field(alias="_typ")] = ComTyp.KOSTENPOSITION positionstitel: Optional[str] = None """Ein Titel für die Zeile. Hier kann z.B. der Netzbetreiber eingetragen werden, wenn es sich um Netzkosten handelt.""" From 36a7fbe08f9743e1478bdbf550ee960360277870 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 11:12:10 +0100 Subject: [PATCH 20/26] fix preis and tarifpreis --- src/bo4e/com/preis.py | 2 +- src/bo4e/com/tarifpreis.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bo4e/com/preis.py b/src/bo4e/com/preis.py index c3f7d17d8..4399c7535 100644 --- a/src/bo4e/com/preis.py +++ b/src/bo4e/com/preis.py @@ -34,7 +34,7 @@ class Preis(COM): """ - typ: Annotated[Union[Literal[ComTyp.PREIS], Literal[ComTyp.TARIFPREIS]], Field(alias="_typ")] = ComTyp.PREIS + typ: Annotated[Literal[ComTyp.PREIS], Field(alias="_typ")] = ComTyp.PREIS wert: Optional[Decimal] = None """Gibt die nominale Höhe des Preises an.""" diff --git a/src/bo4e/com/tarifpreis.py b/src/bo4e/com/tarifpreis.py index 83d31ba30..db5a50f4d 100644 --- a/src/bo4e/com/tarifpreis.py +++ b/src/bo4e/com/tarifpreis.py @@ -31,7 +31,7 @@ class Tarifpreis(Preis): """ - typ: Annotated[Union[Literal[ComTyp.PREIS], Literal[ComTyp.TARIFPREIS]], Field(alias="_typ")] = ComTyp.TARIFPREIS + typ: Annotated[Literal[ComTyp.TARIFPREIS], Field(alias="_typ")] = ComTyp.TARIFPREIS # type:ignore[assignment] preistyp: Optional["Preistyp"] = None """ Angabe des Preistypes (z.B. Grundpreis)""" From 65662e59ebd716da574d24e64fc70ec4945123a5 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 11:16:02 +0100 Subject: [PATCH 21/26] remove unused imports --- src/bo4e/com/kostenposition.py | 2 +- src/bo4e/com/preis.py | 2 +- src/bo4e/com/tarifpreis.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bo4e/com/kostenposition.py b/src/bo4e/com/kostenposition.py index 8db5154e9..945966396 100644 --- a/src/bo4e/com/kostenposition.py +++ b/src/bo4e/com/kostenposition.py @@ -2,7 +2,7 @@ Contains Kostenposition """ -from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union +from typing import TYPE_CHECKING, Annotated, Literal, Optional import pydantic from pydantic import Field diff --git a/src/bo4e/com/preis.py b/src/bo4e/com/preis.py index 4399c7535..24868c060 100644 --- a/src/bo4e/com/preis.py +++ b/src/bo4e/com/preis.py @@ -3,7 +3,7 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union +from typing import TYPE_CHECKING, Annotated, Literal, Optional from pydantic import Field diff --git a/src/bo4e/com/tarifpreis.py b/src/bo4e/com/tarifpreis.py index db5a50f4d..be1eadeff 100644 --- a/src/bo4e/com/tarifpreis.py +++ b/src/bo4e/com/tarifpreis.py @@ -2,7 +2,7 @@ Contains Tarifpreis class """ -from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union +from typing import TYPE_CHECKING, Annotated, Literal, Optional from pydantic import Field From 2b13fb866838fc8ff486d38a3cdd8faaefaf4d44 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 11:17:19 +0100 Subject: [PATCH 22/26] fix preisgarantie and regionalepreisgarantie --- src/bo4e/com/preisgarantie.py | 6 ++---- src/bo4e/com/regionalepreisgarantie.py | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bo4e/com/preisgarantie.py b/src/bo4e/com/preisgarantie.py index 1069c987e..afefd613c 100644 --- a/src/bo4e/com/preisgarantie.py +++ b/src/bo4e/com/preisgarantie.py @@ -2,7 +2,7 @@ Contains Preisgarantie class """ -from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union +from typing import TYPE_CHECKING, Annotated, Literal, Optional from pydantic import Field @@ -31,9 +31,7 @@ class Preisgarantie(COM): """ - typ: Annotated[ - Union[Literal[ComTyp.PREISGARANTIE], Literal[ComTyp.REGIONALEPREISGARANTIE]], Field(alias="_typ") - ] = ComTyp.PREISGARANTIE + typ: Annotated[Literal[ComTyp.PREISGARANTIE], Field(alias="_typ")] = ComTyp.PREISGARANTIE preisgarantietyp: Optional["Preisgarantietyp"] = None """Festlegung, auf welche Preisbestandteile die Garantie gewährt wird.""" diff --git a/src/bo4e/com/regionalepreisgarantie.py b/src/bo4e/com/regionalepreisgarantie.py index ddb565878..a34e15138 100644 --- a/src/bo4e/com/regionalepreisgarantie.py +++ b/src/bo4e/com/regionalepreisgarantie.py @@ -30,7 +30,9 @@ class RegionalePreisgarantie(Preisgarantie): """ - typ: Annotated[Literal[ComTyp.REGIONALEPREISGARANTIE], Field(alias="_typ")] = ComTyp.REGIONALEPREISGARANTIE + typ: Annotated[Literal[ComTyp.REGIONALEPREISGARANTIE], Field(alias="_typ")] = ( + ComTyp.REGIONALEPREISGARANTIE # type:ignore[assignment] + ) regionale_gueltigkeit: Optional["RegionaleGueltigkeit"] = None """Regionale Eingrenzung der Preisgarantie.""" From c97fc24ea7d9874269146e3f4bff7cd95f530d4f Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 11:18:30 +0100 Subject: [PATCH 23/26] fix preisstaffel and regionalepreisstaffel --- src/bo4e/com/preisstaffel.py | 6 ++---- src/bo4e/com/regionalepreisstaffel.py | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bo4e/com/preisstaffel.py b/src/bo4e/com/preisstaffel.py index 31875b83c..0a14fa53b 100644 --- a/src/bo4e/com/preisstaffel.py +++ b/src/bo4e/com/preisstaffel.py @@ -3,7 +3,7 @@ """ from decimal import Decimal -from typing import TYPE_CHECKING, Annotated, Literal, Optional, Union +from typing import TYPE_CHECKING, Annotated, Literal, Optional from pydantic import Field @@ -32,9 +32,7 @@ class Preisstaffel(COM): """ - typ: Annotated[Union[Literal[ComTyp.PREISSTAFFEL], Literal[ComTyp.REGIONALEPREISSTAFFEL]], Field(alias="_typ")] = ( - ComTyp.PREISSTAFFEL - ) + typ: Annotated[Literal[ComTyp.PREISSTAFFEL], Field(alias="_typ")] = ComTyp.PREISSTAFFEL einheitspreis: Optional[Decimal] = None """Preis pro abgerechneter Mengeneinheit""" diff --git a/src/bo4e/com/regionalepreisstaffel.py b/src/bo4e/com/regionalepreisstaffel.py index fbcfe589b..24c76054a 100644 --- a/src/bo4e/com/regionalepreisstaffel.py +++ b/src/bo4e/com/regionalepreisstaffel.py @@ -30,7 +30,9 @@ class RegionalePreisstaffel(Preisstaffel): """ - typ: Annotated[Literal[ComTyp.REGIONALEPREISSTAFFEL], Field(alias="_typ")] = ComTyp.REGIONALEPREISSTAFFEL + typ: Annotated[Literal[ComTyp.REGIONALEPREISSTAFFEL], Field(alias="_typ")] = ( + ComTyp.REGIONALEPREISSTAFFEL # type:ignore[assignment] + ) regionale_gueltigkeit: Optional["RegionaleGueltigkeit"] = None """Regionale Eingrenzung der Preisstaffel""" From 6e40c52a59f1a949e6494728da58862320748d7e Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 11:19:49 +0100 Subject: [PATCH 24/26] fix docstring --- src/bo4e/com/zaehlzeitregister.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bo4e/com/zaehlzeitregister.py b/src/bo4e/com/zaehlzeitregister.py index a6ed510eb..f11e4df4d 100644 --- a/src/bo4e/com/zaehlzeitregister.py +++ b/src/bo4e/com/zaehlzeitregister.py @@ -34,6 +34,6 @@ class Zaehlzeitregister(COM): zaehlzeit_definition: Optional[str] = None """Zählzeitdefinition""" zaehlzeit_register: Optional[str] = None - """ZählzeitRegister""" + """Zählzeitregister""" ist_schwachlastfaehig: Optional[bool] = None """Schwachlastfaehigkeit""" From e0b6606e49d7465708e2aa72df7031df9429fc5b Mon Sep 17 00:00:00 2001 From: kevin <68426071+hf-krechan@users.noreply.github.com> Date: Fri, 21 Mar 2025 11:20:58 +0100 Subject: [PATCH 25/26] Fix docstring in ComTyp --- src/bo4e/enum/comtyp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bo4e/enum/comtyp.py b/src/bo4e/enum/comtyp.py index 8c44ec2b5..f855c79e1 100644 --- a/src/bo4e/enum/comtyp.py +++ b/src/bo4e/enum/comtyp.py @@ -4,7 +4,7 @@ class ComTyp(StrEnum): """ - Auflistung sämtlicher existierender Geschäftsobjekte. + Auflistung sämtlicher existierender Komponenten. """ ADRESSE = "ADRESSE" From 26a799214ee238c5d2d0646a6c29afc507a04c18 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 21 Mar 2025 11:27:01 +0100 Subject: [PATCH 26/26] add hint how to distinguish component and business object --- src/bo4e/enum/botyp.py | 4 ++++ src/bo4e/enum/comtyp.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/bo4e/enum/botyp.py b/src/bo4e/enum/botyp.py index 9122b500f..846f1bd5d 100644 --- a/src/bo4e/enum/botyp.py +++ b/src/bo4e/enum/botyp.py @@ -5,6 +5,10 @@ class BoTyp(StrEnum): """ Auflistung sämtlicher existierender Geschäftsobjekte. + + .. HINT:: + Die Unterscheidung zwischen Komponenten und Geschäftsobjekten ist, dass Komponenten immer in einem Geschäftsobjekt enthalten sind. + Geschäftsobjekte können auch ohne Komponenten existieren. """ ANGEBOT = "ANGEBOT" diff --git a/src/bo4e/enum/comtyp.py b/src/bo4e/enum/comtyp.py index f855c79e1..afca3294d 100644 --- a/src/bo4e/enum/comtyp.py +++ b/src/bo4e/enum/comtyp.py @@ -5,6 +5,10 @@ class ComTyp(StrEnum): """ Auflistung sämtlicher existierender Komponenten. + + .. HINT:: + Die Unterscheidung zwischen Komponenten und Geschäftsobjekten ist, dass Komponenten immer in einem Geschäftsobjekt enthalten sind. + Komponenten sind also immer Teil von einem Geschäftsobjekt und können nicht alleine existieren. """ ADRESSE = "ADRESSE"