CRM

CRM data model

- `Company`: organization identity and basic communication details. - `Contact`: person, optionally attached to a company. - `Lead`: early demand with stage, owner, value, and next

Use this when...

Use this when you need detailed reference information for CRM.

Entities

  • Company: organization identity and basic communication details.
  • Contact: person, optionally attached to a company.
  • Lead: early demand with stage, owner, value, and next action.
  • Opportunity: qualified commercial pipeline with outcome and lost reason.
  • FollowUp: dated action linked to relevant CRM records, with creator and optional assignee.
  • CrmActivity: append-oriented CRM timeline entry linked to records affected by a mutation.

Companies and contacts are optional on leads and opportunities so incomplete enquiries can be captured without inventing data. Assignment points to active internal users in the UI; foreign keys use SET NULL where history should survive relationship removal. CRM activities cascade with their CRM record while the cross-system ActivityLog remains independent.

Money uses PostgreSQL DECIMAL(14,2). Dates are stored as timestamps. Indexes support stage dashboards, assignment queues, next actions, and due/overdue follow-up queries.

Developer Details
Source
apps/docs/content/crm/data-model.md
Owner
Module Owner
Status
Current
Module
CRM
Related route
/crm