# FinancialStatementLineItem

## Description

FinancialStatementLineItem represents a single row in a generated FinancialStatement. Each line item carries a label, current period amount, optional comparative period amount, line type (DETAIL for individual accounts, SUBTOTAL for group aggregations, TOTAL for section totals), section type indicating where it appears in the statement, sort order for display, and optional references to the account or account group it represents. Line items are created during financial statement generation and are immutable once the parent statement is finalized.

## Domain Model Definitions

### Model type

Standard

### Command Definitions

- [generateFinancialStatement](../commands/GenerateFinancialStatement.md) - Line items are created as part of financial statement generation

### Query Definitions

- [GetFinancialStatement](../queries/GetFinancialStatement.md) - Line items are returned as part of the parent financial statement

### Models

- FinancialStatementLineItem

### Invariants

- Each line item must belong to a valid FinancialStatement
- Line type must be one of DETAIL, SUBTOTAL, or TOTAL
- Section type is required and indicates the report section (e.g., Current Assets, Non-Current Liabilities, Revenue, Operating Expenses) where the line item appears
- Label is required and must be non-empty
- Amount is required and denominated in the company's base currency
- Comparative amount is present only when comparative period data was requested
- Sort order determines display positioning within the statement
- Accounts not assigned to any account group are reported in an "Unclassified" section
- Line items are immutable once the parent FinancialStatement is FINALIZED

### Relationships

- **References FinancialStatement**: Each line item belongs to a FinancialStatement via financialStatementId
- **References AccountGroup**: Optionally references an AccountGroup via accountGroupId (coa-management module)
- **References Account**: Optionally references an Account via accountId for DETAIL line items (coa-management module)
