// lib/accounting/core/journal-types.ts

import { AccountingEventType } from './accounting-event-registry';

export interface JournalEntry {
  id: string;
  documentId: string;
  postingSequence: number;
  eventType: AccountingEventType;
  previousJournalHash: string | null;
  currentJournalHash: string;
  baseCurrency: string;
  transactionCurrency: string;
  exchangeRateSnapshot: number;
  currencyPrecision: number;
  lines: JournalLine[];
  createdAt: string;
  postingRuleVersion: string;
}

export interface JournalLine {
  accountCode: string;
  debit: number;
  credit: number;
  branchId?: string;
  costCenterId?: string;
  projectId?: string;
  warehouseId?: string;
  supplierId?: string;
  // ...other dimensions
  meta?: Record<string, any>;
}
