Technical docs

Data Models

Core entities, relationships, and state machines in the Acctally system.

Core Entities

The foundation of Acctally's multi-tenancy model. Users belong to Organizations and access Workspaces where all financial data is isolated.

User

Authentication identity. Users can belong to multiple organizations and access multiple workspaces. Super admins have platform-wide access.

Organization

Billing and team management entity. Handles subscription, billing email, and controls how many workspaces can be created.

Workspace

Data isolation boundary. Each workspace has its own base currency, jurisdiction, fiscal year settings, and completely isolated financial data. The tenant_idfield in all data tables references the Workspace ID.

Access Control

Organization Roles

  • owner - Full control, billing access
  • admin - Manage team and workspaces
  • member - Access granted workspaces

Workspace Roles

  • admin - Full workspace control
  • accountant - Create and post transactions
  • viewer - Read-only access to data

Transaction Lifecycle

Transactions flow through a defined status progression from creation to posting.

open

Initial state. Can be edited.

needs_review

Flagged for manual review.

approved

Ready to post to ledger.

posted

Immutable. Journal entry created.

reversed

Canceled via reversing entry.

Accounting Model

Double-entry accounting with proper ledger structure. Transactions create journal entries that debit and credit accounts.

Account Types

assetliabilityequityrevenueexpensecost_of_goods_sold

Money Account Subtypes

  • bank - Bank accounts (checking, savings)
  • cash - Physical cash on hand
  • clearing - Payment processor clearing (Stripe, Paystack)
  • wallet - Digital wallets

Journal Entry Types

  • standard - Regular transactions
  • opening - Opening balances at period start
  • adjusting - Period-end adjustments
  • closing - Period-end closing entries
  • reversing - Corrections and reversals

Journal Entry Lifecycle

Journal entries must balance (debits = credits) before posting.

Immutability Rules

  • Posted entries cannot be edited
  • Corrections are made via reversing entries
  • All entries include audit trail (created_by, posted_by, timestamps)
  • FX rate is locked at posting time