Transactions table (#7)
Reviewed-on: #7 Co-authored-by: Mathias <mathias2784@web.de>
This commit was merged in pull request #7.
This commit is contained in:
@@ -3,6 +3,7 @@ from pathlib import Path
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.ingest._common import _reader_raw, _upsert
|
||||
from src.ingest.transactions import consolidate_transactions, map_b4w_to_transaction
|
||||
from src.models.b4w import B4wDb, B4wExport, Category, CategoryDb
|
||||
|
||||
|
||||
@@ -67,4 +68,11 @@ def ingest_b4w(path: Path, session: Session):
|
||||
data = reader_b4w(path)
|
||||
for row in data:
|
||||
upsert_b4w(session, row, do_commit=False)
|
||||
consolidate_transactions(
|
||||
session,
|
||||
source="b4w",
|
||||
StagingDb=B4wDb,
|
||||
mapper=map_b4w_to_transaction,
|
||||
do_commit=False,
|
||||
)
|
||||
session.commit()
|
||||
|
||||
Reference in New Issue
Block a user