Verified Commit 07213fcd authored by Jakob Moser's avatar Jakob Moser
Browse files

Add basic BankAccount

It contains the IBAN (which we don't technically need to initialize FinTS, we only need the BLZ, which we will derive); the username and FinTS URL, and the FinTS-Produktregistrierungsnummer (`product_id`).

The documentation comments tell a bit more about the URL and the FinTS-Produktregistrierungsnummer
parent 9eb574f3
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
from schwifty import IBAN
from sqlalchemy.orm import Mapped, mapped_column

from poolpay.model.Base import Base
from poolpay.model.Iban import Iban


class BankAccount(Base):
    """
    A bank account at a German credit institute.
    """

    __tablename__ = "bank_account"

    iban: Mapped[IBAN] = mapped_column(Iban())
    user: Mapped[str]

    # URL for the bank's FinTS endpoint. Not specific to this account, only specific to this bank
    # (and, to be precise, usually even only specific to this brand of bank, as individual bank branches
    # seem to generally not run their own infrastructure). We store it here nevertheless, because we can't be bothered.
    #
    # To find this URL for your bank, you can either search the web (usually, the bank should provide it somewhere),
    # or consult the FinTS Bankenliste (https://www.fints.org/de/hersteller/bankenliste), which is a large Excel file
    # you will receive once you have registered your FinTS product.
    url: Mapped[str]

    # FinTS-Produktregistrierungsnummer for this software. Not specific to this account, only specific to PoolPay itself.
    # We should store it in some general config, but again, couldn't be bothered.
    # Technically, if we hadn't registered the product as "FinTS Kernel" (which seems to be for individual/testing use
    # only), we could have just hardcoded the product ID).
    product_id: Mapped[str]