-
Notifications
You must be signed in to change notification settings - Fork 5
Tarifzeiten Modul3 #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
enet-Rossier
wants to merge
32
commits into
bo4e:main
Choose a base branch
from
enet-Rossier:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Tarifzeiten Modul3 #989
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
eab1bca
WIP: Änderungen an verschiedenen Datein zur Implementierung von Tarif…
enet-Rossier 5752465
WIP: Änderungen an verschiedenen Datein zur Implementierung von Tarif…
enet-Rossier 370e6c0
WIP: Änderungen an verschiedenen Datein zur Implementierung von Tarif…
enet-Rossier 814abbf
WIP: Änderungen an verschiedenen Datein zur Implementierung von Tarif…
enet-Rossier bfce41d
WIP: Änderungen an verschiedenen Datein zur Implementierung von Tarif…
enet-Rossier 5b5ca65
WIP: Änderungen an verschiedenen Datein zur Implementierung von Tarif…
enet-Rossier 49c404d
Merge branch 'main' into tarifzeiten_modul3
enet-Rossier 144bc0a
WIP: Änderungen an verschiedenen Datein zur Implementierung von Tarif…
enet-Rossier ba2bd5d
WIP: Tarifstufen entfernt und durch Str ersetzt
enet-Rossier c81f475
Merge remote-tracking branch 'upstream/main'
enet-Rossier 932c888
Merge branch 'main' into main
DeltaDaniel f986787
Merge branch 'main' into main
DeltaDaniel 20141af
Linting
7f19913
Merge branch 'main' into main
XaMa928 3c084cd
Linting
26fc402
Merge branch 'main' into main
XaMa928 d906faf
Testfix: serialization_roundtrip nur mit Toplevel Attributen
53f32fb
Testfix?
5a60968
Testfix? imports aus bo4e ohne subdirectory
5b2f1f3
imports homogenisiert
bb40dbd
Umbau auf TYPE_CHECKING imports
b97a1d9
__init__.py ergänzt
2e7456c
rename Tarifzeit to Tarifzeitstufe to prevent ambigious naming
bb462f9
fix test after renaming
4701fa6
Fix Linting
02182ed
#989 added UML and removed duplication in docs
a44f683
Merge branch 'main' into main
XaMa928 5666cb7
#989 Doc Linting
949f18f
#989 Doc Linting
8c07c7e
#989 Doc Linting
f03f598
#989 Doc Linting
04be10c
Merge branch 'main' into main
enet-Rossier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| """ | ||
| Contains Tarifzeiten class | ||
| """ | ||
|
|
||
| from typing import List, Optional, Annotated, Literal | ||
| from pydantic import Field | ||
|
|
||
| from ..enum.botyp import BoTyp | ||
| from ..utils import postprocess_docstring | ||
| from .geschaeftsobjekt import Geschaeftsobjekt | ||
|
|
||
| from ..bo.marktteilnehmer import Marktteilnehmer | ||
| from ..com.tarifzeitenzeitscheibe import TarifzeitenZeitscheibe | ||
|
|
||
|
|
||
| @postprocess_docstring | ||
| class Tarifzeiten(Geschaeftsobjekt): | ||
| """ | ||
| Abbildung von Tarifzeiten, wann welche Preise gelten oder unter welchen Bedingungen. | ||
| """ | ||
|
lord-haffi marked this conversation as resolved.
|
||
|
|
||
| typ: Annotated[Optional[Literal[BoTyp.TARIFZEITEN]], Field(alias="_typ")] = BoTyp.TARIFZEITEN | ||
| """Typ des Geschäftsobjekts – default 'TARIFZEITEN'""" | ||
|
lord-haffi marked this conversation as resolved.
Outdated
|
||
|
|
||
| marktteilnehmer: Optional["Marktteilnehmer"] = None | ||
| """Optionaler Verweis auf den Anbieter / Marktpartner""" | ||
|
|
||
| zeitscheiben: Optional[List["TarifzeitenZeitscheibe"]] = None | ||
| """Liste von Zeitabschnitten, die tarifliche Regelungen enthalten""" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| """ | ||
| Contains Tarifzeit class | ||
| """ | ||
|
|
||
| from typing import Optional, Annotated, Literal | ||
| from pydantic import Field | ||
|
|
||
| from .. import COM, ComTyp | ||
| from ..utils import postprocess_docstring | ||
| from ..com.zeitraum import Zeitraum | ||
|
|
||
|
|
||
| @postprocess_docstring | ||
| class Tarifzeit(COM): | ||
| """ | ||
| Tarifzeit mit Zuordnung zu einem Zeitraum und einer optionalen Tarifstufe. | ||
| """ | ||
|
|
||
| typ: Annotated[Optional[Literal[ComTyp.TARIFZEIT]], Field(alias="_typ")] = ComTyp.TARIFZEIT | ||
| """Typ der Tarifzeit – default 'TARIFZEIT'""" | ||
|
|
||
| zeitraum: Optional[Zeitraum] = None | ||
| """Gültigkeitszeitraum der Tarifzeit""" | ||
|
|
||
| tarifstufe: Optional[str] = None | ||
| """Optional: Angabe der Tarifstufe, z. B. HT, NT, ST""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| """ | ||
| Contains TarifzeitenZeitscheibe class | ||
| """ | ||
|
|
||
| from typing import Optional, List, Annotated, Literal | ||
| from pydantic import Field | ||
|
|
||
| from .. import COM, ComTyp | ||
| from ..utils import postprocess_docstring | ||
|
|
||
| from ..com.zeitraum import Zeitraum | ||
| from ..com.tarifzeit import Tarifzeit | ||
|
|
||
|
|
||
| @postprocess_docstring | ||
| class TarifzeitenZeitscheibe(COM): | ||
| """ | ||
| Eine Zeitscheibe innerhalb der Tarifzeiten mit zugehöriger Gültigkeit und Tarifzeitabschnitten. | ||
| """ | ||
|
lord-haffi marked this conversation as resolved.
|
||
| typ: Annotated[ | ||
| Optional[Literal[ComTyp.TARIFZEITENZEITSCHEIBE]], Field(alias="_typ")] = ComTyp.TARIFZEITENZEITSCHEIBE | ||
| """Typ dieser Zeitscheibe - Default 'TARIFZEITENZEITSCHEIBE'""" | ||
|
lord-haffi marked this conversation as resolved.
Outdated
|
||
|
|
||
| gueltigkeit: Optional[Zeitraum] = None | ||
| """Zeitraum, in dem diese Zeitscheibe gültig ist""" | ||
|
|
||
| tarifzeiten: Optional[List[Tarifzeit]] = None | ||
| """Liste von Tarifzeiten, z. B. NT, HT oder weitere Zeitmodelle""" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import pytest | ||
|
|
||
| from datetime import date | ||
| from bo4e import Zeitraum | ||
| from bo4e.com.tarifzeit import Tarifzeit | ||
| from tests.serialization_helper import assert_serialization_roundtrip | ||
|
|
||
|
|
||
| class TestTarifzeit: | ||
| @pytest.mark.parametrize( | ||
| "tarifzeit", | ||
| [ | ||
| pytest.param( | ||
| Tarifzeit( | ||
| zeitraum=Zeitraum( | ||
| startdatum=date(2025, 1, 1), | ||
| enddatum=date(2025, 1, 31), | ||
| ), | ||
| tarifstufe="HT", | ||
| ) | ||
| ) | ||
| ] | ||
| ) | ||
| def test_serialization_roundtrip(self, tarifzeit: Tarifzeit) -> None: | ||
| """ | ||
| Test de-/serialisation of Tarifzeit. | ||
| """ | ||
| assert_serialization_roundtrip(tarifzeit) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| from datetime import date | ||
|
|
||
| import pytest | ||
|
|
||
| from bo4e import Marktteilnehmer, Zeitraum | ||
| from bo4e.bo.tarifzeiten import Tarifzeiten | ||
| from bo4e.com.tarifzeit import Tarifzeit | ||
| from bo4e.com.tarifzeitenzeitscheibe import TarifzeitenZeitscheibe | ||
| from tests.serialization_helper import assert_serialization_roundtrip | ||
|
|
||
|
|
||
| class TestTarifzeiten: | ||
| @pytest.mark.parametrize( | ||
| "tarifzeiten", | ||
| [ | ||
| pytest.param( | ||
| Tarifzeiten( | ||
| marktteilnehmer=Marktteilnehmer(), | ||
| zeitscheiben=[TarifzeitenZeitscheibe( | ||
| gueltigkeit=Zeitraum( | ||
| startdatum=date(2025, 1, 1), | ||
| enddatum=date(2025, 1, 31), | ||
| ), | ||
| tarifzeiten=[Tarifzeit( | ||
| zeitraum=Zeitraum( | ||
| startdatum=date(2025, 1, 1), | ||
| enddatum=date(2025, 1, 31), | ||
| ), | ||
| tarifstufe="HT", | ||
| )])] | ||
| ) | ||
| ) | ||
|
|
||
| ] | ||
| ) | ||
| def test_serialization_roundtrip(self, tarifzeiten: Tarifzeiten) -> None: | ||
| """ | ||
| Test de-/serialisation of Tarifzeit. | ||
| """ | ||
| assert_serialization_roundtrip(tarifzeiten) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| from datetime import date | ||
|
|
||
| import pytest | ||
|
|
||
| from bo4e import Zeitraum | ||
| from bo4e.com.tarifzeit import Tarifzeit | ||
| from bo4e.com.tarifzeitenzeitscheibe import TarifzeitenZeitscheibe | ||
| from tests.serialization_helper import assert_serialization_roundtrip | ||
|
|
||
|
|
||
| class TestTarifzeitenZeitscheibe: | ||
| @pytest.mark.parametrize( | ||
| "zeitscheibe", | ||
| [ | ||
| pytest.param( | ||
| TarifzeitenZeitscheibe( | ||
| gueltigkeit=Zeitraum( | ||
| startdatum=date(2025, 1, 1), | ||
| enddatum=date(2025, 1, 31), | ||
| ), | ||
| tarifzeiten=[ | ||
| Tarifzeit( | ||
| zeitraum=Zeitraum( | ||
| startdatum=date(2025, 1, 1), | ||
| enddatum=date(2025, 1, 31), | ||
| ), | ||
| tarifstufe="HT", | ||
| ) | ||
| ], | ||
| ) | ||
| ) | ||
| ] | ||
| ) | ||
| def test_serialization_roundtrip(self, zeitscheibe: TarifzeitenZeitscheibe) -> None: | ||
| """ | ||
| Test de-/serialisation of TarifzeitenZeitscheibe. | ||
| """ | ||
| assert_serialization_roundtrip(zeitscheibe) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.