23 lines
src/ledger/types.ts
Core types for the ledger service.
// Ledger domain types.
 
export type TransactionType = "debit" | "credit";
 
export interface LedgerTransaction {
  id: string;
  accountId: string;
  type: TransactionType;
  /**
   * Transaction magnitude in cents — always a positive integer.
   * The transaction type determines whether this amount is added or subtracted.
   */
  amount: number;
  description: string;
  timestamp: number;
}
 
export interface Account {
  id: string;
  /** Current balance in cents. */
  balance: number;
  currency: string;
}