export type AssetClass = "Renta Variable" | "Renta Fija" | "Liquidez"; export interface Holding { name: string; value: number; changeAmount: number; changePercent: number; assetClass: AssetClass; region: string; } export interface Portfolio { asOf: string; cash: number; invested: number; marketValueChange: number; marketValueChangePercent: number; assetAllocation: Record; holdings: Holding[]; } export interface HistorySnapshot { date: string; marketValue: number; } export interface History { snapshots: HistorySnapshot[]; } /** * aportacion/retirada = external cash flow (bank <-> account) and count toward TWR/baseline math. * suscripcion_fondo/reembolso_fondo = internal moves between cash and a fund; net-zero on total * account value, so they're excluded from flow math but still shown in the movements ledger. * apertura = informational account-opening marker. */ export type MovementKind = | "aportacion" | "retirada" | "suscripcion_fondo" | "reembolso_fondo" | "apertura" | "otro"; export interface Movement { id: string; date: string; kind: MovementKind; amount: number; description?: string; } export type Frequency = "weekly" | "biweekly" | "monthly" | "quarterly" | "yearly"; export interface RecurringPlan { id: string; amount: number; frequency: Frequency; startDate: string; endDate?: string; active: boolean; note?: string; } export interface Contributions { recurringPlans: RecurringPlan[]; movements: Movement[]; } export interface Settings { inceptionDate: string; forecastYears: number; returnAssumption: "historical" | "custom"; customAnnualReturnPct?: number; } export interface SP500Point { date: string; close: number; } export interface SP500Data { source: string; updatedAt: string; series: SP500Point[]; }