# Account Management

## Overview

Account Management owns the minimal company-scoped GL account master record. Each account has a code, name, account type, company, and status.

All accounts are posting accounts when ACTIVE. The module does not model account groups, report groups, non-posting headers, AP/AR control-account semantics, tax defaults, currency restrictions, or reconciliation behavior.

## Business Purpose

- **Stable account identity**: `code` and `name` identify the GL account that downstream modules post to.
- **Financial statement type**: `accountType` classifies the account as ASSET, LIABILITY, EQUITY, REVENUE, or EXPENSE.
- **Company scoping**: Accounts belong directly to a company.
- **Simple lifecycle**: INACTIVE accounts remain queryable but cannot receive new postings.

## Process Flow

```mermaid
flowchart TD
    A[Create company account] --> B[Account status ACTIVE]
    B --> C{No longer usable?}
    C -- Yes --> D[Deactivate to INACTIVE]
    D --> E{Usable again?}
    E -- Yes --> B
```

## Scenario Patterns

- **Standard account setup**: Create cash, payable, revenue, and expense accounts as flat ACTIVE posting accounts.
- **Account retirement**: Deactivate an account that should no longer receive new postings while keeping it queryable.
- **Account correction**: Rename or renumber an account while it remains under the same company.

## Test Cases

- Account code is required, numeric, and unique within the company
- Account name is required and must be non-empty
- Account type must be ASSET, LIABILITY, EQUITY, REVENUE, or EXPENSE
- Account is created in ACTIVE status
- ACTIVE account can be deactivated
- INACTIVE account can be reactivated
- Accounts can be listed by company, type, and status

## Reference Links

- [SoftLedger Chart of Accounts](https://softledger.com/support/en/articles/10246988-chart-of-accounts)
- [Odoo Chart of Accounts](https://www.odoo.com/documentation/19.0/applications/finance/accounting/get_started/chart_of_accounts.html)
