Files
SimpleFinanceDash/src/lib/types.ts
2026-04-02 14:29:36 +02:00

84 lines
1.4 KiB
TypeScript

export type CategoryType =
| "income"
| "bill"
| "variable_expense"
| "debt"
| "saving"
| "investment"
export type ItemTier = "fixed" | "variable" | "one_off"
export interface Profile {
id: string
display_name: string | null
locale: string
currency: string
created_at: string
updated_at: string
}
export interface Category {
id: string
user_id: string
name: string
type: CategoryType
icon: string | null
sort_order: number
created_at: string
updated_at: string
}
export interface Template {
id: string
user_id: string
name: string
created_at: string
updated_at: string
}
export interface TemplateItem {
id: string
template_id: string
category_id: string
item_tier: Exclude<ItemTier, "one_off">
budgeted_amount: number
sort_order: number
created_at: string
updated_at: string
category?: Category
}
export interface Budget {
id: string
user_id: string
start_date: string
end_date: string
currency: string
carryover_amount: number
created_at: string
updated_at: string
}
export interface BudgetItem {
id: string
budget_id: string
category_id: string
budgeted_amount: number
actual_amount: number
item_tier: ItemTier
notes: string | null
created_at: string
updated_at: string
category?: Category
}
export interface QuickAddItem {
id: string
user_id: string
name: string
icon: string | null
sort_order: number
created_at: string
updated_at: string
}