Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Bankverbindung #884

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/bo4e/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
"Zaehlertyp",
"ZaehlertypSpezifikation",
"ZusatzAttribut",
"Bankverbindung",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Das sollte alphabetisch einsortiert sein

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oder wird das hier irgendwie so autogeneriert?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ne händisch, ich meine aber dass mir gesagt wurde dass das aber auto sortiert werden soll

"__version__",
"__gh_version__",
]
Expand Down Expand Up @@ -247,6 +248,7 @@
from .com.aufabschlagstaffelproort import AufAbschlagstaffelProOrt
from .com.ausschreibungsdetail import Ausschreibungsdetail
from .com.ausschreibungslos import Ausschreibungslos
from .com.bankverbindung import Bankverbindung
from .com.betrag import Betrag
from .com.com import COM
from .com.dienstleistung import Dienstleistung
Expand Down
42 changes: 42 additions & 0 deletions src/bo4e/com/bankverbindung.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""
Contains Bankverbindung class and corresponding marshmallow schema for de-/serialization
"""

# pylint: disable=too-few-public-methods, too-many-instance-attributes
# pylint: disable=no-name-in-module
from typing import TYPE_CHECKING, Optional

from ..utils import postprocess_docstring
from .com import COM

if TYPE_CHECKING:
from ..enum.preismodell import Preismodell
from ..enum.rechnungslegung import Rechnungslegung
from ..enum.sparte import Sparte
from ..enum.vertragsform import Vertragsform
from .ausschreibungsdetail import Ausschreibungsdetail
from .menge import Menge
from .zeitraum import Zeitraum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

welchen dieser importe verwenden wir hier überhaupt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.



@postprocess_docstring
class Bankverbindung(COM):
"""
Eine Komponente zur Abbildung einer einzelner Bankverbindung

.. raw:: html

<object data="../_static/images/bo4e/com/Bankverbindung.svg" type="image/svg+xml"></object>

.. HINT::
`Bankverbindung JSON Schema <https://json-schema.app/view/%23?url=https://raw.githubusercontent.com/BO4E/BO4E-Schemas/{__gh_version__}/src/bo4e_schemas/com/Bankverbindung.json>`_

"""

iban: Optional[str] = None

kontoinhaber: Optional[str] = None

bankkennung: Optional[str] = None

bankname: Optional[str] = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wäre ganz gut, hier docstrings zu haben. Insbesondere bei bankkennung. Soll das ein SWIFT Code sein?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

26 changes: 26 additions & 0 deletions tests/test_bankverbindung.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pytest

from bo4e import Bankverbindung
from tests.serialization_helper import assert_serialization_roundtrip


class TestBankverbindung:
@pytest.mark.parametrize(
"bankverbindung",
[
pytest.param(
Bankverbindung(
iban="foo-ban",
kontoinhaber="Jürgen W.",
bankkennung="1234Geiz5678",
bankname="Geiz&Geiziger",
),
id="maximal attributes",
),
],
)
def test_serialization_roundtrip(self, bankverbindung: Bankverbindung) -> None:
"""
Test de-/serialisation of Ausschreibungslos
"""
assert_serialization_roundtrip(bankverbindung)
Loading