> ## Documentation Index
> Fetch the complete documentation index at: https://docs.earthcare.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Data model overview

> The entities behind Earth Care Network and how they relate — two hubs (Business and Organization) plus the Context, metering, automation, and GTM domains.

ECN's schema has **two hubs**: **Business** (the public directory entity) and
**Organization** (the workspace tenant). Almost everything else hangs off one of them.

```mermaid theme={null}
erDiagram
  ORGANIZATION ||--o{ MEMBERSHIP : has
  ORGANIZATION ||--o| CREDITWALLET : owns
  ORGANIZATION ||--o{ CONTACT : owns
  ORGANIZATION ||--o{ DEAL : owns
  ORGANIZATION ||--o{ WORKFLOW : owns
  ORGANIZATION ||--o{ USAGEEVENT : meters
  ORGANIZATION ||--o{ GTMPROFILE : owns
  BUSINESS ||--o| CONTEXTPACK : compiles_to
  BUSINESS ||--o{ CONTEXTDOCUMENT : has
  BUSINESS ||--o{ BUSINESSRELATIONSHIP : connects
  ORGANIZATION ||--o{ BUSINESS : scopes
  CONTACT ||--o{ DEAL : drives
  GTMPROFILE ||--o{ GTMLEAD : discovers
  GTMLEAD ||--o| CONTACT : syncs_to
```

## Domains

<CardGroup cols={2}>
  <Card title="Directory" icon="map" href="/data-model/directory">
    Business, Category, Tag, relationships, claims & nominations.
  </Card>

  <Card title="CRM" icon="users" href="/data-model/crm">
    Organization, Membership, Contact, Account, Deal, Task, Forms.
  </Card>

  <Card title="Context" icon="book" href="/data-model/context">
    ContextPack & ContextDocument — the AI-ready surface.
  </Card>

  <Card title="Metering & billing" icon="coins" href="/data-model/metering-billing">
    UsageEvent, CreditWallet, CreditTransaction, RateCard, plans.
  </Card>

  <Card title="Automation" icon="diagram-project" href="/data-model/automation">
    Workflow, Step, Enrollment, StepRun, OutreachDraft.
  </Card>

  <Card title="Enterprise & GTM" icon="rocket" href="/data-model/enterprise-gtm">
    GtmProfile, GtmLead, Campaign, affiliate program.
  </Card>
</CardGroup>

## Conventions worth knowing

* **UUID primary keys** on most records.
* **pgvector embeddings (1536-dim)** on `Business`, `ContextDocument`, `ContextPack`,
  and `RecruitRole` for semantic search and agent retrieval.
* **Immutable ledgers** — `UsageEvent` and `CreditTransaction` are append-only.
* **Status progressions** — e.g. `Business`: `SEEDED → NOMINATED → CLAIMED → VERIFIED`;
  AI-authored content enters as `seeded` and is never auto-verified.
* **Tenant isolation** — workspace data is scoped to `Organization`; cross-tenant
  reads are rejected.

<Note>
  Per-domain field tables on the following pages are generated from the live Django
  models (`manage.py dump_schema_docs`) and re-synced to `test` each docs iteration,
  so they track the v2 refactor rather than drifting.
</Note>
