81 lines
1.4 KiB
TypeScript
81 lines
1.4 KiB
TypeScript
// Types for the banking management application
|
|
|
|
export interface Transaction {
|
|
id: string
|
|
accountId: string
|
|
date: string
|
|
amount: number
|
|
description: string
|
|
type: "DEBIT" | "CREDIT"
|
|
categoryId: string | null
|
|
isReconciled: boolean
|
|
fitId: string // OFX unique transaction ID
|
|
memo?: string
|
|
checkNum?: string
|
|
}
|
|
|
|
export interface Account {
|
|
id: string
|
|
name: string
|
|
bankId: string
|
|
accountNumber: string
|
|
type: "CHECKING" | "SAVINGS" | "CREDIT_CARD" | "OTHER"
|
|
folderId: string | null
|
|
balance: number
|
|
currency: string
|
|
lastImport: string | null
|
|
}
|
|
|
|
export interface Folder {
|
|
id: string
|
|
name: string
|
|
parentId: string | null
|
|
color: string
|
|
icon: string
|
|
}
|
|
|
|
export interface Category {
|
|
id: string
|
|
name: string
|
|
color: string
|
|
icon: string
|
|
keywords: string[] // For auto-categorization
|
|
parentId: string | null
|
|
}
|
|
|
|
export interface CategoryRule {
|
|
id: string
|
|
categoryId: string
|
|
pattern: string
|
|
isRegex: boolean
|
|
}
|
|
|
|
export interface BankingData {
|
|
accounts: Account[]
|
|
transactions: Transaction[]
|
|
folders: Folder[]
|
|
categories: Category[]
|
|
categoryRules: CategoryRule[]
|
|
}
|
|
|
|
// OFX Parsed types
|
|
export interface OFXTransaction {
|
|
fitId: string
|
|
date: string
|
|
amount: number
|
|
name: string
|
|
memo?: string
|
|
checkNum?: string
|
|
type: string
|
|
}
|
|
|
|
export interface OFXAccount {
|
|
bankId: string
|
|
accountId: string
|
|
accountType: string
|
|
balance: number
|
|
balanceDate: string
|
|
currency: string
|
|
transactions: OFXTransaction[]
|
|
}
|