# README

<!-- This section should contain the following subsections in order: -->
<!-- 1. ## Overview (required) -->
<!-- 2. ## Key Features (required) -->
<!-- 3. ## Module Scope (required) -->
<!-- 4. ## Module Dependencies (required) -->

## Overview

The financial-accounting module owns the financial accounting foundation for ERP
transactions. It provides the general ledger, accounting periods, fiscal years,
posting controls, and the journal entry records used by sales, purchase,
inventory, manufacturing, and management
accounting modules.

The module is intentionally broader than a general-ledger-only module. It is the
home for GL postings and the accounting-side AP/AR foundation: open items,
payment clearing, cash receipt clearing, and bank reconciliation belong here as
financial accounting facts. Operational documents such as customer invoices,
vendor bills, sales orders, purchase orders, shipments, and goods receipts remain
owned by their upstream modules.

## Key Features

- Double-entry journal entry posting with immutable posted entries and reversal-only corrections
- Fiscal year and accounting period management with posting status controls
- Journal entries for validated financial impact from sales, purchase, inventory, manufacturing, and accounting workflows
- AP/AR accounting foundation for future open item, clearing, and reconciliation workflows

## Module Scope

### In Scope

- General ledger journal entries, prepared journal lines, and posted AccountingLedger facts
- Posting, reversal, adjusting entries, and opening/closing entries
- Fiscal years, accounting periods, and period status transitions
- Source document references that preserve the origin of financial impact
- Accounting-side AP/AR open item and clearing foundations
- Bank and cash reconciliation foundations tied to posted accounting ledger facts

### Out of Scope

- Chart of accounts and account master governance, owned by `coa-management`
- Cost centers, profit centers, budgets, allocations, commitments, and variance analysis
- Customer invoice lifecycle, shipment lifecycle, and sales order processing, owned by `sales`
- Vendor bill lifecycle, purchase order processing, and goods receipt matching, owned by `purchase`
- Inventory valuation source events and stock movement lifecycle, owned by `inventory`
- Manufacturing order costing source events and production lifecycle, owned by `manufacturing`
- Bank connectivity, bank feed ingestion, and payment execution rails

### Scope Decision Rationale

`financial-accounting` is the financial record of business activity, not the
operational system that creates that activity. Upstream modules own business
documents and domain-specific validation. This module records source document
references on immutable journal entries, enforces accounting controls, and
tracks accounting settlement state.

Upstream modules should not introduce generic transfer tables merely to
communicate with `financial-accounting`. When a business document is posted, for
example an issued sales invoice or a matched supplier bill, that posting workflow
should record the financial impact in the same unit of work where the platform
can guarantee atomicity.

This boundary keeps the module compatible with both SoftLedger-style API-first
financial accounting and SAP FI-style separation between financial accounting,
management accounting, chart of accounts governance, and operational logistics.

## Module Dependencies

- `coa-management` - GL account references used by journal lines and posting validation
- `organization` - Company scope for fiscal calendars, periods, and journal entries
