feat: Engine+Schema fuer Szenario-Ende und szenario-eigene Einmalzahlungen

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 11:46:52 +02:00
parent aa1884c31e
commit 5519037688
5 changed files with 127 additions and 1 deletions

View File

@@ -22,3 +22,15 @@ def test_account_transaction_roundtrip(db):
db.add(tx)
db.commit()
assert db.query(Transaction).one().amount == Decimal("-50.00")
def test_scenario_planned_item_roundtrip(db):
from app.models.tables import Scenario, ScenarioPlannedItem
sc = Scenario(name="SPI-Test", description="")
db.add(sc)
db.flush()
db.add(ScenarioPlannedItem(scenario_id=sc.id, name="Einmalzahlung",
amount=Decimal("5000.00"), due=date(2026, 7, 30)))
db.commit()
item = db.query(ScenarioPlannedItem).one()
assert item.amount == Decimal("5000.00") and item.scenario_id == sc.id