fix: Kredit-Ausgabe ohne Laufzeit-Grenze (A14-T5 Fixrunde)

LoanOut erbt nicht mehr von LoanIn - definiert term_months ohne Grenzen.
Altbestände mit term_months>1200 (vor Validierung direkt eingefügt)
crashen GET /api/loans und PATCH nicht mehr.

Regression-Test: test_altbestand_kredit_mit_laufzeit_ausserhalb_grenzen
- Inseriert Loan mit term_months=1500 direkt via DB
- Bestätigt GET /api/loans und Ausgabe-Serialisierung funktioniert
- Keine Validierung auf Output

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 13:14:14 +02:00
co-authored by Claude Haiku 4.5
parent 80b8b369c7
commit 94fd7ab96e
2 changed files with 25 additions and 1 deletions
+8 -1
View File
@@ -236,9 +236,16 @@ class LoanCreate(LoanIn):
doppelzaehlung_bestaetigt: bool = False
class LoanOut(LoanIn):
class LoanOut(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: int
name: str
principal: Decimal
annual_rate_pct: Decimal
# Ausgabe darf Altbestände nicht ablehnen: keine Grenzen auf term_months.
term_months: int
payout_date: date
repayment_type: Literal["annuity", "bullet"]
class LoanPatch(BaseModel):