Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
38 changes: 38 additions & 0 deletions src/bo4e/com/bankverbindung.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
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 Optional

from ..utils import postprocess_docstring
from .com import COM


@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
# International Bank Account Number = IBAN for example: DE07 1234 1234 1234 1234 12

kontoinhaber: Optional[str] = None
# individual or entity in whose name a bank account is registered and who has legal rights over it

bankkennung: Optional[str] = None
# A unique code, such as a BIC (Bank Identifier Code) or SWIFT code, that identifies a specific bank in
# international transactions (e.g., BIC: DEUTDEFF for Deutsche Bank)

bankname: Optional[str] = None
Comment on lines +36 to +37
Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

# name of the bank e.g. Deutsche Bank
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

kannst du deutsche docstrings drauß machen?
also einmal mit : nach dem #und dann halt inhaltlich auf deutsch?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

hast du ein bsp für mich wie du es genau haben willst?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

so?
648d26f

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="DE07123412341234123412",
kontoinhaber="Jürgen W.",
bankkennung="DEUTDEFF",
bankname="Deutsche Bank",
),
id="maximal attributes",
),
],
)
def test_serialization_roundtrip(self, bankverbindung: Bankverbindung) -> None:
"""
Test de-/serialisation of Ausschreibungslos
"""
assert_serialization_roundtrip(bankverbindung)