---
sidebar_position: 3
title: Data Model & Entity Hierarchy
description: Understand the relational architecture of GAAPx subsidiary ledger including Tenants, Legal Entities, Customers, Contracts, POBs, Invoices, and Journal Entries.
keywords:
  - data model
  - entity hierarchy
  - tenant architecture
  - performance obligation schema
  - revenue subledger schema
---

# Data Model & Entity Hierarchy

**The GAAPx Data Model** provides a multi-tenant, multi-entity subsidiary ledger structure designed to support complex B2B enterprise hierarchies, co-termed contracts, multi-currency operations, and strict ASC 606 revenue subledger auditability.

```mermaid
erDiagram
    TENANT ||--o{ LEGAL_ENTITY : contains
    LEGAL_ENTITY ||--o{ CUSTOMER : owns
    CUSTOMER ||--o{ CONTRACT : executes
    CONTRACT ||--o{ CONTRACT_LINE : includes
    CONTRACT_LINE ||--o{ PERFORMANCE_OBLIGATION : creates
    CONTRACT ||--o{ BILLING_SCHEDULE : defines
    BILLING_SCHEDULE ||--o{ INVOICE : generates
    INVOICE ||--o{ PAYMENT_APPLICATION : settles
    PERFORMANCE_OBLIGATION ||--o{ REVENUE_SCHEDULE : amortizes
    REVENUE_SCHEDULE ||--o{ JOURNAL_ENTRY : exports
```

---

## Core Entities & Definitions

### 1. Tenant & Legal Entity
* **Tenant**: The top-level organization representing the GAAPx customer account.
* **Legal Entity**: Distinct operating companies, subsidiaries, or international entities (e.g., *Acme US Inc.*, *Acme UK Ltd.*) with independent charts of accounts, functional currencies, and tax IDs.

### 2. Customer & Hierarchy
* **Customer**: The buying organization. Supports multi-level parent/child hierarchies (e.g., Global Enterprise $\to$ Regional Subsidiary $\to$ Departmental Division).
* **Billing Contact**: Designates invoice delivery email addresses, AP portal credentials, and payment methods.

### 3. Contract, Order Form & Line Items
* **Contract (Master Agreement / MSA)**: The commercial container governing payment terms, auto-renewal rules, and governing law.
* **Order Form / SOW**: Child agreements representing specific purchase commitments, start/end dates, and total contract value (TCV).
* **Contract Line Item**: Specific products/services purchased, quantity, unit price, discounts, and contracted delivery milestones.

:::info SCREENSHOT PLACEHOLDER: Contract Entity Graph
**Location in App**: `App > Contracts > [Contract ID] > Entity Graph`  
**Visual Description**: Interactive node graph showing the relationship between Customer Account, MSA, child Order Forms, POBs, and Invoices.  
**Recommended Dimensions**: `1200 x 675`  
:::

---

## The Dual Subledger Data Separation

GAAPx strictly decouples the **Billing Subledger** from the **Revenue Subledger**:

```mermaid
flowchart TD
  Contract["Executed Contract ($120k TCV)"] --> Billing["Billing Subledger"]
  Contract --> RevRec["Revenue Subledger"]

  subgraph BillingSubledger ["Billing Subledger (Cash & AR)"]
    Billing --> Inv["Annual Upfront Invoice ($120k)"]
    Inv --> AR["Accounts Receivable Debit"]
    Inv --> Pay["Payment Match ($120k via ACH)"]
  end

  subgraph RevenueSubledger ["Revenue Subledger (ASC 606)"]
    RevRec --> POB["POB: SaaS Access ($120k SSP)"]
    POB --> Amort["12 Monthly Amortization Schedules ($10k/mo)"]
    Amort --> RevJE["Monthly Dr. Deferred Rev / Cr. Revenue"]
  end
```

### 4. Billing Subledger Entities
* **Billing Schedule**: Scheduled date, billing rule (in advance / in arrears), milestone criteria, and draft status.
* **Invoice**: The finalized commercial invoice containing line items, calculated sales tax, remittance details, and ERP sync ID.
* **Payment & Cash Application**: Record of transaction settlement (Stripe charge ID, Plaid bank deposit, manual wire reference) linked directly to invoice IDs.

### 5. Revenue Subledger Entities
* **Performance Obligation (POB)**: Distinct good or service identified under ASC 606 Step 2 with allocated Standalone Selling Price (SSP).
* **Revenue Schedule**: Daily or monthly amortization ledger recording recognized revenue, contract liability (deferred revenue), and contract asset balances.
* **Journal Entry (JE)**: Balanced debit/credit batch prepared for ERP general ledger posting.
