feat: vorgefertigte Import-Presets für Raiffeisen (CH) und Revolut
- services/csv_import: PRESETS-Liste (aus echten Beispiel-Exporten des Nutzers), GET /imports/presets. - Frontend: Preset-Auswahl im Import füllt Format/Spalten automatisch. Beide Presets per TestClient gegen echte Zeilenformate verifiziert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,39 @@ from ..models import (
|
||||
from . import currency
|
||||
|
||||
|
||||
# Vorgefertigte Bank-Vorlagen (aus echten Export-Beispielen). Erscheinen im
|
||||
# Import als auswählbare Presets und füllen die Format-/Spalten-Einstellungen.
|
||||
PRESETS: list[dict] = [
|
||||
{
|
||||
"name": "Raiffeisen (CH)",
|
||||
"delimiter": ";",
|
||||
"decimal_sep": ".",
|
||||
"date_format": "%Y-%m-%d %H:%M:%S.%f",
|
||||
"encoding": "utf-8",
|
||||
"has_header": False,
|
||||
"skip_rows": 0,
|
||||
"amount_mode": "signed",
|
||||
# Spalten: 0=eigene IBAN, 1=Datum, 2=Text, 3=Betrag, 4=Saldo, 5=Valuta.
|
||||
"column_map": {"date": 1, "amount": 3, "payee": 2,
|
||||
"purpose": None, "counterparty_iban": None},
|
||||
},
|
||||
{
|
||||
"name": "Revolut",
|
||||
"delimiter": ",",
|
||||
"decimal_sep": ".",
|
||||
"date_format": "%Y-%m-%d %H:%M:%S",
|
||||
"encoding": "utf-8",
|
||||
"has_header": True,
|
||||
"skip_rows": 0,
|
||||
"amount_mode": "signed",
|
||||
# Spalten: 0=Typ, 1=Produkt, 2=Start, 3=Abgeschlossen, 4=Beschreibung,
|
||||
# 5=Betrag, 6=Gebühr, 7=Währung, 8=Status, 9=Saldo.
|
||||
"column_map": {"date": 3, "amount": 5, "payee": 4,
|
||||
"purpose": None, "counterparty_iban": None},
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# --- Kleine Parser-Helfer --------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user