# postJournalEntry

## Overview

Posts a DRAFT journal entry to the ledger (DRAFT → POSTED). Posting is allowed only
when the entry balances (Σdebit = Σcredit), has at least two lines, references active
GL accounts, and its accounting period is OPEN. A posted entry is immutable and can
only be corrected by a reversal. Thin wrapper over the native `postJournalEntry`.

## Modules Commands Used

- [financial-accounting] postJournalEntry

## Exception Handling

| Error Code | Description |
| --- | --- |
| FINANCIAL_ACCOUNTING_JOURNAL_ENTRY_NOT_FOUND | The journal entry does not exist |
| FINANCIAL_ACCOUNTING_INVALID_STATUS_FOR_POSTING | The entry is not in DRAFT status |
| FINANCIAL_ACCOUNTING_MINIMUM_LINES_NOT_MET | The entry has fewer than two lines |
| FINANCIAL_ACCOUNTING_INVALID_PERIOD_STATUS | The accounting period is not OPEN |
| FINANCIAL_ACCOUNTING_UNBALANCED_ENTRY | Total debits do not equal total credits |
| FINANCIAL_ACCOUNTING_ACCOUNT_NOT_FOUND | A referenced GL account does not exist |
| FINANCIAL_ACCOUNTING_ACCOUNT_INACTIVE | A referenced GL account is inactive |
