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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user