import type { JournalEntry } from './skr.classes.journalentry.js'; import type { TSKRType, ITransactionData, ITransactionView, IJournalEntry, IAccountBalance } from './skr.types.js'; /** * Ledger operations of one chart on the hashed journal. Posting, reversing, * history and balances all go through the unified journal path * (skr.journalbooking.ts, JournalPoster, the balance aggregation). */ export declare class Ledger { private skrType; private logger; private poster; constructor(skrType: TSKRType); /** * Post a transaction as a hashed two-line journal entry. Returns its * transaction-shaped view. */ postTransaction(transactionData: ITransactionData): Promise; /** * Post a journal entry with validation. Returns the hashed, immutable entry. */ postJournalEntry(journalData: IJournalEntry): Promise; /** * Validate accounts against SKR standard data */ private validateAccountsAgainstSKR; /** * Reverse a two-line entry via Storno; the original is never mutated (GoBD). * Returns the Storno's transaction view. */ reverseTransaction(transactionId: string): Promise; /** * Reverse a journal entry via Storno; the original is never mutated (GoBD). */ reverseJournalEntry(journalId: string): Promise; /** * Account history: one view per journal line on the account, by date. */ getAccountHistory(accountNumber: string, dateFrom?: Date, dateTo?: Date): Promise; /** * Get account balance at a specific date */ getAccountBalance(accountNumber: string, asOfDate?: Date): Promise; /** * Close accounting period (create closing entries) */ closeAccountingPeriod(period: string, // Format: YYYY-MM closingAccountNumber?: string): Promise; /** * Validate double-entry rules */ validateDoubleEntry(debitAmount: number, creditAmount: number): boolean; /** * Get unbalanced transactions (for audit). The journal poster enforces an * exact balance atomically, so there are none; chain integrity is checked * with verifyHashChain(). */ getUnbalancedTransactions(): Promise; /** * Recalculate the balance fields every account caches (debitTotal, * creditTotal, balance) from the journal. */ recalculateAllBalances(): Promise; }