feat(b4w): add human-readable B4wExport repr/str output; fix comdirect account lookup and export formatting helpers
This commit is contained in:
@@ -31,12 +31,14 @@ class EXPECT_LINE(Enum):
|
||||
type ComdirectExportModel = ComdirectGiro | ComdirectDepot | ComdirectCreditCard
|
||||
|
||||
|
||||
SOURCE_COMDIRECT = BANK_ACCOUNTS.get("Comdirect")
|
||||
SOURCE_COMDIRECT = BANK_ACCOUNTS.get("comdirect")
|
||||
assert isinstance(SOURCE_COMDIRECT, Source)
|
||||
|
||||
SOURCE_PATH = SOURCE_COMDIRECT.source_path
|
||||
ACCOUNTS = SOURCE_COMDIRECT.accounts
|
||||
|
||||
COMDIRECT_ACCOUNT_PARSERS = {a.name: a.model.model_validate for a in ACCOUNTS}
|
||||
|
||||
|
||||
def reader_comdirect(path: Path) -> dict[str, list[ComdirectExportModel]]:
|
||||
result = {}
|
||||
@@ -122,11 +124,11 @@ def upsert_comdirect_giro(
|
||||
|
||||
def ingest_comdirect(path: Path, account_iban: str, account_currency: str):
|
||||
assert SOURCE_COMDIRECT
|
||||
data_collection = reader_comdirect(SOURCE_PATH)
|
||||
data_collection = reader_comdirect(path)
|
||||
for account_name, data in data_collection.items():
|
||||
account = SOURCE_COMDIRECT.get_account(account_name)
|
||||
assert isinstance(account, Account)
|
||||
if account_name == "Comdirect":
|
||||
if account_name == "Girokonto":
|
||||
db_load_function = lambda session_, row_, account_: upsert_comdirect_giro(
|
||||
session=session_,
|
||||
data=row_,
|
||||
|
||||
Reference in New Issue
Block a user