CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Legal

⚖️ Legal · Database ERD

Legal Matter and Billing Schema

A schema for law firm matters and billing: clients, matters, timekeepers, time entries, expenses, invoices and trust accounts.

More Legal templates

Opening a template is free and never counts toward your daily diagrams. Asking the AI to change it counts as one.

Drawing diagram…

What this diagram shows

  • Every time entry and expense belongs to a matter
  • Billing rates depend on the timekeeper and the matter
  • Client trust (advance) money is tracked separately

Prompt used

ERD for legal billing: Client has Matters; Timekeeper (lawyer, paralegal) has a default rate; MatterRate can override rates per matter; TimeEntry records hours and narrative by a Timekeeper on a Matter; Expense records costs; Invoice groups unbilled entries for a Matter; TrustAccount holds client advances with TrustTransactions applied to invoices.

Mermaid code
erDiagram
  CLIENT ||--o{ MATTER : engages
  MATTER ||--o{ TIME_ENTRY : logs
  TIMEKEEPER ||--o{ TIME_ENTRY : records
  MATTER ||--o{ MATTER_RATE : sets
  TIMEKEEPER ||--o{ MATTER_RATE : "billed at"
  MATTER ||--o{ EXPENSE : incurs
  MATTER ||--o{ INVOICE : bills
  CLIENT ||--o| TRUST_ACCOUNT : holds
  TRUST_ACCOUNT ||--o{ TRUST_TRANSACTION : records
  MATTER {
    int id PK
    int client_id FK
    string matter_no
    string practice_area
  }
  TIME_ENTRY {
    int id PK
    int matter_id FK
    int timekeeper_id FK
    decimal hours
    string narrative
    bool billed
  }
  INVOICE {
    int id PK
    int matter_id FK
    decimal amount
    string status
  }

Inside this diagram

An entity relationship diagram with 9 tables, 14 columns and 9 relationships.

Tables and their columns

  • CLIENT
  • MATTER: id (PK), client_id (FK), matter_no, practice_area
  • TIME_ENTRY: id (PK), matter_id (FK), timekeeper_id (FK), hours, narrative, billed
  • TIMEKEEPER
  • MATTER_RATE
  • EXPENSE
  • INVOICE: id (PK), matter_id (FK), amount, status
  • TRUST_ACCOUNT
  • TRUST_TRANSACTION

Relationships

  • CLIENT engages MATTER: each CLIENT has zero or more MATTER, each MATTER belongs to exactly one CLIENT
  • MATTER logs TIME_ENTRY: each MATTER has zero or more TIME_ENTRY, each TIME_ENTRY belongs to exactly one MATTER
  • TIMEKEEPER records TIME_ENTRY: each TIMEKEEPER has zero or more TIME_ENTRY, each TIME_ENTRY belongs to exactly one TIMEKEEPER
  • MATTER sets MATTER_RATE: each MATTER has zero or more MATTER_RATE, each MATTER_RATE belongs to exactly one MATTER
  • TIMEKEEPER billed at MATTER_RATE: each TIMEKEEPER has zero or more MATTER_RATE, each MATTER_RATE belongs to exactly one TIMEKEEPER
  • MATTER incurs EXPENSE: each MATTER has zero or more EXPENSE, each EXPENSE belongs to exactly one MATTER
  • MATTER bills INVOICE: each MATTER has zero or more INVOICE, each INVOICE belongs to exactly one MATTER
  • CLIENT holds TRUST_ACCOUNT: each CLIENT has zero or one TRUST_ACCOUNT, each TRUST_ACCOUNT belongs to exactly one CLIENT
  • TRUST_ACCOUNT records TRUST_TRANSACTION: each TRUST_ACCOUNT has zero or more TRUST_TRANSACTION, each TRUST_TRANSACTION belongs to exactly one TRUST_ACCOUNT

Make your own diagram like this

Describe your own system in plain English and the AI ER diagram generator draws it in seconds, in the same style as this template.

Related templates

State MachineLegal

Contract Lifecycle (CLM)

The states of a commercial contract in a contract lifecycle management system, from request and drafting to renewal or expiry.

SequenceLegal

E-Signature Flow

How a document gets signed electronically by several parties in order, with identity checks and a tamper-evident audit trail.

C4 ArchitectureProLegal

Legal Case Management Architecture

A law firm's case management platform: matters, documents, court dates, time tracking and billing, with a client portal.

FlowchartLegal

Legal Document Review and Approval

How a contract or legal document is reviewed inside a company: intake, playbook check, risk rating, approvals and signature.

Data FlowLegal

E-Discovery Data Pipeline

How electronic evidence is collected and reviewed in litigation: legal hold, collection, processing, review and production to the other side.

State MachineLegal

Litigation Case Lifecycle

The stages of a civil court case from filing to judgment and appeal, including settlement at any point.