comdirect ingest: some code structurerefinement

This commit is contained in:
2026-09-11 10:16:51 +02:00
parent f50b28a387
commit d502e9ef0d
11 changed files with 83 additions and 40 deletions
View File
-10
View File
@@ -1,10 +0,0 @@
from src.models import ComdirectCreditCard, ComdirectDepot, ComdirectGiro
ACCOUNT_INGESTION_FUNCTIONS = {
"comdirect": {
"Girokonto": lambda x: ComdirectGiro.model_validate(x),
"Visa-Karte (Kreditkarte)": lambda x: ComdirectCreditCard.model_validate(x),
"Tagesgeld PLUS-Konto": lambda x: ComdirectGiro.model_validate(x),
"Depot": lambda x: ComdirectDepot.model_validate(x),
}
}
+18
View File
@@ -0,0 +1,18 @@
from enum import Enum
IBAN_PATTERN = r"^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$"
class Currency(str, Enum):
EUR = "EUR"
USD = "USD"
GBP = "GBP"
CHF = "CHF"
def __str__(self):
return self.value
def __repr__(self):
return f"Currency.{self.name}"
+14
View File
@@ -0,0 +1,14 @@
from collections.abc import Callable
from pydantic import BaseModel, Field
from src.settings.constants import IBAN_PATTERN, Currency
class AccountInfo(BaseModel):
iban: str = Field(pattern=IBAN_PATTERN)
ingestion_function: Callable
currency: Currency