@company-manager/docs

CRM Domain

UML diagrams for leads, opportunities, clients, and sales pipeline

CRM Domain

The CRM domain manages customer relationships including lead tracking, opportunity management, client onboarding, and sales pipeline processes.

Domain Overview

graph TB
    subgraph "Lead Management"
        LEAD[Lead]
        QUALIFY[Qualification]
        SCORE[Lead Scoring]
    end

    subgraph "Opportunity Management"
        OPP[Opportunity]
        STAGE[Pipeline Stages]
        FORECAST[Forecasting]
    end

    subgraph "Client Management"
        CLIENT[Client]
        CONTACT[Contact]
        ACCOUNT[Account]
    end

    subgraph "Sales Activities"
        TASK[Tasks]
        CALL[Calls]
        MEETING[Meetings]
        EMAIL[Emails]
    end

    LEAD --> QUALIFY
    QUALIFY --> OPP
    OPP --> STAGE
    OPP --> CLIENT

    CLIENT --> CONTACT
    CLIENT --> ACCOUNT

    OPP --> TASK
    OPP --> CALL
    OPP --> MEETING
    OPP --> EMAIL

    style LEAD fill:#e1f5fe
    style OPP fill:#fff3e0
    style CLIENT fill:#e8f5e9

Entity Relationship Diagram

erDiagram
    TENANT ||--o{ LEAD : has
    TENANT ||--o{ OPPORTUNITY : has
    TENANT ||--o{ CLIENT : has

    LEAD ||--o| OPPORTUNITY : converts_to
    LEAD }o--o| CONTACT : associated
    LEAD }o--|| USER : assigned_to

    OPPORTUNITY ||--o{ OPPORTUNITY_PRODUCT : contains
    OPPORTUNITY }o--|| CLIENT : belongs_to
    OPPORTUNITY }o--|| CONTACT : primary_contact
    OPPORTUNITY }o--|| USER : owner
    OPPORTUNITY ||--o{ ACTIVITY : has

    CLIENT ||--o{ CONTACT : has
    CLIENT ||--o{ ADDRESS : has
    CLIENT ||--o{ ORDER : places
    CLIENT }o--o| CLIENT_TYPE : categorized

    CONTACT ||--o{ ACTIVITY : participates
    CONTACT ||--o{ SUBSCRIPTION : has
    CONTACT ||--o{ ORDER : places

    ACTIVITY }o--|| USER : created_by

    LEAD {
        string id PK
        string tenantId FK
        string name
        string email
        string phone
        string company
        enum source
        enum status
        int score
        string assignedTo FK
        timestamp createdAt
        timestamp convertedAt
    }

    OPPORTUNITY {
        string id PK
        string tenantId FK
        string clientId FK
        string contactId FK
        string name
        decimal amount
        enum stage
        float probability
        timestamp expectedCloseDate
        string ownerId FK
        json customFields
    }

    CLIENT {
        string id PK
        string tenantId FK
        string name
        string email
        string phone
        string industry
        string website
        enum tier
        boolean archived
    }

    CONTACT {
        string id PK
        string clientId FK
        string firstName
        string lastName
        string email
        string phone
        string jobTitle
        boolean isPrimary
    }

Key Business Processes

Lead Pipeline

Lead capture, qualification, and conversion flow. View Lead Pipeline Details

Opportunity Stages

Sales opportunity progression and forecasting. View Opportunity Details

Client Onboarding

New client setup and activation process. View Onboarding Details

Lead Sources

pie title Lead Sources Distribution
    "Website Form" : 35
    "Referral" : 25
    "Trade Show" : 15
    "Cold Outreach" : 10
    "Social Media" : 8
    "Partner" : 7

Sales Pipeline Overview

flowchart LR
    subgraph "Pipeline Stages"
        PROSPECT[Prospecting]
        QUALIFY[Qualification]
        PROPOSAL[Proposal]
        NEGOTIATE[Negotiation]
        CLOSED[Closed]
    end

    PROSPECT --> QUALIFY
    QUALIFY --> PROPOSAL
    PROPOSAL --> NEGOTIATE
    NEGOTIATE --> CLOSED

    subgraph "Outcomes"
        CLOSED --> WON[Won]
        CLOSED --> LOST[Lost]
    end

    style WON fill:#e8f5e9
    style LOST fill:#ffebee

CRM Metrics

MetricDescription
Lead Conversion RateLeads converted to opportunities
Win RateOpportunities won vs total
Average Deal SizeMean opportunity value
Sales Cycle LengthDays from lead to close
Pipeline ValueTotal potential revenue
Activity RateActivities per opportunity

Integration Points

flowchart TB
    subgraph "CRM Domain"
        LEADS[Leads]
        OPPS[Opportunities]
        CLIENTS[Clients]
    end

    subgraph "Connected Domains"
        ORDERS[Orders]
        SUBS[Subscriptions]
        EMAIL[Email Marketing]
        SUPPORT[Support]
    end

    CLIENTS --> ORDERS
    CLIENTS --> SUBS
    LEADS --> EMAIL
    CLIENTS --> SUPPORT

    style LEADS fill:#e1f5fe
    style CLIENTS fill:#e8f5e9