# Posting principles

## Posting from operations (future)

Operational subsystems (inventory, procurement, sales fulfillment, transfers, etc.) remain **systems of record** for physical and contractual state. Accounting postings will:

1. **Subscribe** to stable operational facts (e.g., receipt posted, fulfillment consumed, transfer completed)—typically via domain events or orchestrated hooks—not by polling mutable drafts.
2. **Translate** those facts into balanced journal entries using agreed **posting rules** (mapping tables / policies per tenant).
3. **Never** alter operational rows as part of posting; feedback from accounting is limited to **status or link fields** reserved for finance (e.g., “accounting document id”), never quantity or movement mutations.

## Idempotency

Posting must be **repeatable without doubling**:

- Each operational source event carries or derives an **idempotency key** for the financial posting worker (e.g., `{source_type}:{source_id}:{posting_sequence}`).
- Retries replay the **same journal outcome**, not a second economic recognition.

## Audit trace

Every posted journal entry should retain:

- **Source system** and **source identifiers** (strong references where possible).
- **Actor** (user or system principal) initiating posting when applicable.
- **Correlation ID** propagated from operations or batch orchestration for end-to-end tracing.

Latency between operation and posting is acceptable; **correctness and deduplication** are not traded for speed.
