import type { Id } from "../_generated/dataModel"; export type BankProviderName = "comdirect" | "fints"; export type NormalizedAccount = { externalId: string; name: string; iban?: string; balance: number; currency: string; }; export type NormalizedBalance = { externalId: string; balance: number; currency: string; }; export type NormalizedTransaction = { externalRef?: string; bookingDate?: string; valueDate?: string; description: string; counterparty?: string; amount: number; vorgang?: string; isPending: boolean; rawText?: string; categoryName?: string; assignedMonth?: string; effectiveMonth?: string; }; export interface BankDataProvider { readonly name: BankProviderName; getAccounts(): Promise; getBalance(accountExternalId: string): Promise; getTransactions( accountExternalId: string, from: string, to: string, ): Promise; } export type SyncJobState = { phase: "init" | "fetch_accounts" | "fetch_transactions" | "persist" | "done"; from: string; to: string; accountId?: Id<"accounts">; provider: BankProviderName; accounts: NormalizedAccount[]; accountIndex: number; rows: Array<{ accountExternalId: string; transactions: NormalizedTransaction[]; }>; }; export type ImportRow = { accountId?: Id<"accounts">; categoryName: string; bookingDate?: string; valueDate?: string; description: string; counterparty?: string; amount: number; vorgang?: string; isPending: boolean; rawText?: string; assignedMonth?: string; effectiveMonth?: string; externalRef?: string; };