Rework real estate model: purchase price + mortgage + amortization only, no appreciation; amortization counts against savings quota; sale price/tax entered at transition time with correct mortgage payoff; carry over income/expenses to new phases
Deploy App / deploy (push) Successful in 1m31s
Deploy App / deploy (push) Successful in 1m31s
This commit is contained in:
+16
-12
@@ -176,19 +176,21 @@ model Security {
|
||||
transitionItems PhaseTransitionItem[]
|
||||
}
|
||||
|
||||
// Eine Immobilie innerhalb einer Phase
|
||||
// Eine Immobilie innerhalb einer Phase. Vereinfachtes Modell: kein Wertsteigerungsfeld,
|
||||
// der Kaufpreis bleibt ueber die Haltedauer fix -- einzig die Hypothek sinkt durch
|
||||
// Amortisation. Verkaufspreis/-steuer werden nicht hier, sondern erst im Uebergangs-
|
||||
// Screen im Moment des Verkaufs erfasst (siehe PhaseTransitionItem).
|
||||
model RealEstate {
|
||||
id String @id @default(cuid())
|
||||
phaseId String
|
||||
phase Phase @relation(fields: [phaseId], references: [id], onDelete: Cascade)
|
||||
name String
|
||||
marketValue Float
|
||||
mortgage Float
|
||||
valueGrowth Float
|
||||
amortization Float
|
||||
salePrice Float?
|
||||
// Geschaetzte Grundstueckgewinnsteuer (%), direkt am ausloesenden Ereignis erfasst (Kap. 9)
|
||||
saleTaxRate Float @default(20)
|
||||
id String @id @default(cuid())
|
||||
phaseId String
|
||||
phase Phase @relation(fields: [phaseId], references: [id], onDelete: Cascade)
|
||||
name String
|
||||
purchasePrice Float
|
||||
mortgage Float
|
||||
amortization Float
|
||||
// Verweist auf die Immobilie der Vorphase, aus der automatisch uebernommen wurde
|
||||
// (nur intern zur Deduplizierung bei wiederholtem Speichern des Uebergangs, kein FK).
|
||||
carriedFromRealEstateId String?
|
||||
|
||||
transitionItems PhaseTransitionItem[]
|
||||
}
|
||||
@@ -242,4 +244,6 @@ model PhaseTransitionItem {
|
||||
realEstate RealEstate? @relation(fields: [realEstateId], references: [id], onDelete: Cascade)
|
||||
decision TransitionDecision
|
||||
salePrice Float?
|
||||
// Nur bei Immobilien-Verkauf erfasst (Grundstueckgewinnsteuer in %), siehe RealEstate.
|
||||
saleTaxRate Float?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user