Last reviewed: 2026-06-16
Account Contract
Canonical object: Account
Required fields: - id - company_id - code - name - account_type - normal_balance - status - posting_status - effective_from - source - version
Allowed account types: - asset - liability - equity - income - expense
Allowed normal balances: - debit - credit
Allowed statuses: - active - inactive - retired
Allowed posting statuses: - posting - non_posting
Allowed sources: - booksplus_standard - module - imported - user_created
Rules:
- Account code must be unique within a company.
- Account identity is immutable and independent from visible code and name.
- Account codes are strings and must preserve leading zeros.
- Accounting behavior must not infer classification from account-number patterns.
- Non-posting report headings are not accounts.
- Posting normally requires an active account.
- Routine posting requires posting_status posting and direct posting to be allowed.
- Used accounts may be retired but not deleted.
- Used accounts may be renamed or renumbered with audit history.
- Historical entries must retain their original account reference.
- Retired accounts must identify a replacement account when a replacement is required by workflow.
Validation expectations:
- code uniqueness by company.
- account_type, normal_balance, and status values use the stable snake_case contract values defined by this contract.
- posting_status and source values use stable snake_case contract values.
- status values support active, inactive, retired, and historical references.
- account references preserved for existing journal lines.
- singleton semantic roles are enforced explicitly by role cardinality.
Related truth pages:
- company.contract.md
- ../accounting/accounts.md
- ../vision-and-product-principles.md