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:
@@ -23,12 +23,10 @@ const securitySchema = z.object({
|
||||
});
|
||||
const realEstateSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
marketValue: z.number(),
|
||||
// Muss zwingend angegeben werden (siehe Anforderung: Kaufpreis ist Pflichtfeld).
|
||||
purchasePrice: z.number().positive("Kaufpreis muss groesser als 0 sein."),
|
||||
mortgage: z.number(),
|
||||
valueGrowth: z.number(),
|
||||
amortization: z.number(),
|
||||
salePrice: z.number().nullable().optional(),
|
||||
saleTaxRate: z.number().min(0).max(100),
|
||||
});
|
||||
const oneTimeEventSchema = z.object({
|
||||
type: z.enum(["INCOME", "EXPENSE"]),
|
||||
@@ -96,7 +94,7 @@ export async function PUT(
|
||||
incomeEntries: { create: data.incomeEntries.map((e) => ({ ...e, label: e.label ?? null, personId: e.personId ?? null })) },
|
||||
expenseEntries: { create: data.expenseEntries.map((e) => ({ ...e, label: e.label ?? null })) },
|
||||
securities: { create: data.securities },
|
||||
realEstates: { create: data.realEstates.map((re) => ({ ...re, salePrice: re.salePrice ?? null })) },
|
||||
realEstates: { create: data.realEstates },
|
||||
oneTimeEvents: { create: data.oneTimeEvents.map((e) => ({ ...e, description: e.description ?? null })) },
|
||||
retirementInfos: { create: data.retirementInfos },
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user