122 lines
2.3 KiB
TypeScript
122 lines
2.3 KiB
TypeScript
export interface FixedDebt {
|
|
id: string
|
|
name: string
|
|
amount: number
|
|
dueDay: number
|
|
category: 'housing' | 'services' | 'subscription' | 'other'
|
|
isAutoDebit: boolean
|
|
isPaid: boolean
|
|
notes?: string
|
|
}
|
|
|
|
export interface VariableDebt {
|
|
id: string
|
|
name: string
|
|
amount: number
|
|
date: string
|
|
category: 'shopping' | 'food' | 'entertainment' | 'health' | 'transport' | 'other'
|
|
isPaid: boolean
|
|
notes?: string
|
|
}
|
|
|
|
export interface CreditCard {
|
|
id: string
|
|
name: string
|
|
lastFourDigits: string
|
|
closingDay: number
|
|
dueDay: number
|
|
currentBalance: number
|
|
creditLimit: number
|
|
color: string
|
|
}
|
|
|
|
export interface CardPayment {
|
|
id: string
|
|
cardId: string
|
|
amount: number
|
|
date: string
|
|
description: string
|
|
installments?: {
|
|
current: number
|
|
total: number
|
|
}
|
|
}
|
|
|
|
export interface MonthlyBudget {
|
|
month: number
|
|
year: number
|
|
totalIncome: number
|
|
fixedExpenses: number
|
|
variableExpenses: number
|
|
savingsGoal: number
|
|
}
|
|
|
|
export interface Alert {
|
|
id: string
|
|
type: 'PAYMENT_DUE' | 'BUDGET_WARNING' | 'CARD_CLOSING' | 'CARD_DUE' | 'SAVINGS_GOAL' | 'UNUSUAL_SPENDING'
|
|
title: string
|
|
message: string
|
|
severity: 'info' | 'warning' | 'danger'
|
|
date: string
|
|
isRead: boolean
|
|
relatedId?: string
|
|
}
|
|
|
|
export interface ServiceBill {
|
|
id: string
|
|
type: 'electricity' | 'water' | 'gas' | 'internet'
|
|
amount: number
|
|
usage?: number
|
|
unit?: string
|
|
date: string
|
|
period: string // YYYY-MM
|
|
isPaid: boolean
|
|
notes?: string
|
|
}
|
|
|
|
export interface Income {
|
|
id: string
|
|
amount: number
|
|
description: string
|
|
date: string
|
|
category: 'salary' | 'freelance' | 'business' | 'gift' | 'other'
|
|
}
|
|
|
|
export interface AppState {
|
|
fixedDebts: FixedDebt[]
|
|
variableDebts: VariableDebt[]
|
|
creditCards: CreditCard[]
|
|
cardPayments: CardPayment[]
|
|
incomes: Income[] // Added incomes
|
|
monthlyBudgets: MonthlyBudget[]
|
|
serviceBills: ServiceBill[]
|
|
alerts: Alert[]
|
|
currentMonth: number
|
|
currentYear: number
|
|
}
|
|
|
|
export interface AIServiceConfig {
|
|
id: string
|
|
name: string
|
|
endpoint: string
|
|
token: string
|
|
model?: string
|
|
}
|
|
|
|
export interface AppSettings {
|
|
telegram: {
|
|
botToken: string
|
|
chatId: string
|
|
}
|
|
aiProviders: AIServiceConfig[]
|
|
}
|
|
|
|
// Auth Types
|
|
export interface User {
|
|
id: string
|
|
username: string
|
|
passwordHash: string
|
|
chatId: string
|
|
knownIps: string[]
|
|
}
|