Initial commit: FPT Financial Planning Tool
Deploy App / deploy (push) Successful in 3m3s

This commit is contained in:
2026-07-08 19:19:39 +02:00
commit 4f990c9686
60 changed files with 12436 additions and 0 deletions
+98
View File
@@ -0,0 +1,98 @@
// Domain-Typen fuer die Berechnungslogik (lib/calculations.ts) und die API-Payloads.
// Bewusst von den generierten Prisma-Typen entkoppelt, damit die Berechnungslogik
// unabhaengig von der konkreten DB-Repraesentation testbar bleibt.
export type HouseholdType = "SINGLE" | "COUPLE";
export type PersonRole = "PERSON_A" | "PERSON_B";
export type IncomeMode = "PER_PERSON" | "HOUSEHOLD";
export type OwnerTag = "PERSON_A" | "PERSON_B" | "HOUSEHOLD";
export type OneTimeEventType = "INCOME" | "EXPENSE";
export type TransitionDecision = "CARRY_OVER" | "SELL";
export type PositionType = "SECURITY" | "REAL_ESTATE";
export interface PersonInput {
id: string;
role: PersonRole;
age: number;
retirementAge: number;
}
export interface HouseholdInput {
id: string;
householdType: HouseholdType;
inflationRateDefault: number;
persons: PersonInput[];
}
export interface IncomeEntryInput {
id: string;
personId: string | null;
label: string | null;
amount: number;
}
export interface ExpenseEntryInput {
id: string;
label: string | null;
amount: number;
}
export interface SecurityInput {
id: string;
name: string;
startValue: number;
expectedReturn: number;
annualContribution: number;
ownerTag: OwnerTag;
saleTaxRate: number;
}
export interface RealEstateInput {
id: string;
name: string;
marketValue: number;
mortgage: number;
valueGrowth: number;
amortization: number;
salePrice: number | null;
saleTaxRate: number;
}
export interface OneTimeEventInput {
id: string;
type: OneTimeEventType;
amount: number;
description: string | null;
}
export interface RetirementInfoInput {
id: string;
personId: string;
ahvAmount: number;
pkPensionAmount: number;
lumpSumAmount: number;
lumpSumTaxRate: number;
}
export interface PhaseInput {
id: string;
sequenceNumber: number;
name: string;
durationYears: number;
inflationRate: number | null;
incomeMode: IncomeMode;
incomeEntries: IncomeEntryInput[];
expenseEntries: ExpenseEntryInput[];
securities: SecurityInput[];
realEstates: RealEstateInput[];
oneTimeEvents: OneTimeEventInput[];
retirementInfos: RetirementInfoInput[];
}
export interface PlanInput {
id: string;
name: string;
parentPlanId: string | null;
branchFromPhaseId: string | null;
phases: PhaseInput[];
}