CURRENT CANONICAL BASELINE
Version: v41
Status: CRM timeline edit and deletion governance refinement
Next planned package: v42

# Dispatch Spot — CRM and Partner Lifecycle Plan

## Current phase note
- v42 adds governed CRM timeline editing, soft deletion, and edit/deletion reason capture so partner history remains useful without becoming an uncontrolled note stream.
- v43 should extend assignment workflows with reminders, overdue states, and assignee queue visibility.


# Dispatch Spot — CRM and Partner Lifecycle Plan

## Purpose
Dispatch Spot now needs a formal CRM layer that serves the commercial side of freight operations, not just the dispatch side.

This CRM layer must support the full lifecycle of the key relationship types that feed and sustain the business:
- Brokers
- Drivers
- Companies / Carriers
- Owner Operators
- Shippers

The CRM should not be a lightweight contact list. Each relationship type should become a structured operating record with:
- full profile data
- relationship stage tracking
- activity and notes history
- commercial metrics
- partner/customer classification
- future automation hooks

## Core CRM Entity Types

### 1. Broker
Track brokers as dispatch-facing commercial partners.

Core profile data should include:
- legal business name
- DBA / trade name
- main contact(s)
- phone, email, website
- MC / DOT / factoring / payment terms where relevant
- lanes and preferences
- insurance / setup packet status
- average payment behavior
- internal trust / quality assessment

### 2. Driver
Drivers should remain operational records and also support relationship history.

CRM-style fields should include:
- employment or engagement status
- onboarding stage
- communication log
- recruiting notes
- performance notes
- retention / satisfaction indicators
- owner operator or company driver classification

### 3. Company / Carrier
Add a first-class entity for the business being served or partnered with.

This should represent:
- motor carrier companies
- fleet operators
- dispatcher clients
- carriers with multiple trucks

Core profile data should include:
- legal name
- DBA
- MC / DOT / EIN where appropriate
- mailing / operating address
- billing contacts
- dispatch contacts
- fleet size
- equipment profile
- payment terms
- onboarding and compliance records

### 4. Owner Operator
Owner Operators should be represented as a distinct relationship type even when they also map to a driver and truck.

This entity should capture the business/operator hybrid nature of the role:
- personal contact data
- business name if applicable
- truck ownership / lease context
- preferred lanes
- settlement preferences
- compliance document status
- onboarding stage
- commercial and operational notes

### 5. Shipper
Add shippers as a first-class commercial CRM entity.

Core profile data should include:
- legal business name
- industry / commodity type
- shipping locations
- primary and backup contacts
- billing and AP contacts
- payment terms
- load frequency
- service requirements
- preferred lanes
- contract / pricing notes

## Relationship Stage Model
Use one shared lifecycle model across CRM entities, with room to extend later.

### Recommended default stages
- Lead
- Contacted
- Warm
- Hot
- Active Partner / Customer
- Premium Partner / Customer
- Inactive
- Lost

These stages should be implemented as a reusable CRM lifecycle system rather than hardcoded separately for each entity type.

## Required Commercial Metrics
Each CRM entity should support two high-level commercial metrics:

### Revenue In
Money brought into the business by that relationship.
Examples:
- broker load revenue
- shipper invoiced revenue
- company or owner operator generated dispatch revenue

### Payments Out
Money paid out because of that relationship.
Examples:
- driver settlements
- owner operator payouts
- partner incentives
- service fees paid to related parties

These two metrics should exist both:
- at the individual record level
- as aggregate CRM reporting dimensions later

## Modern CRM Features Required
To remain competitive, the CRM layer should eventually include the following capabilities.

### Activity timeline
Every CRM record should support a timeline of:
- notes
- calls
- emails logged manually or automatically later
- meetings
- status changes
- document uploads
- relationship stage changes

### Tasks and follow-ups
Users should be able to attach tasks to CRM records:
- follow up call
- send packet
- request insurance
- onboarding checklist item
- payment follow-up

### Tagging and segmentation
Allow flexible tags such as:
- Reefer
- Flatbed
- High Value
- Slow Pay
- Priority Shipper
- Recruiting Prospect

### Smart filters and saved views
Examples:
- hot brokers
- active shippers
- slow-paying brokers
- warm owner operators
- inactive drivers

### Notes and relationship intelligence
Support structured notes and eventually AI-assisted summaries such as:
- last touchpoint
- risk flags
- best contact time
- relationship health

### Document attachment
CRM records should support attached documents such as:
- setup packets
- W-9
- insurance documents
- contracts
- carrier packets
- compliance docs

### Stage-change history
Keep an auditable history of how a record moved from:
- lead
- contacted
- warm
- hot
- active

### Basic reminders and alerts
Examples:
- no contact in 14 days
- compliance document expiring
- premium partner not touched recently
- shipper payment trending late

### Revenue and payout analytics
Eventually support dashboards such as:
- revenue by broker
- revenue by shipper
- payouts by owner operator
- relationship profitability by company

## Recommended Architecture

### CRM should be its own architecture layer
Add a formal CRM layer to the product roadmap.

Suggested subdomains:
- crm-core
- crm-activities
- crm-tasks
- crm-lifecycle
- crm-documents
- crm-analytics

### Shared CRM model
Instead of building five unrelated mini-CRMs, use a shared framework:
- profile data
- lifecycle stage
- tags
- notes
- activities
- tasks
- documents
- metrics

Then layer entity-specific fields on top.

## Recommended Schema Direction
This package does not change the live schema yet. It preserves the correct next schema direction.

### Base CRM concepts to introduce later
- `CrmEntityType`
- `CrmLifecycleStage`
- `CrmTag`
- `CrmActivity`
- `CrmTask`
- `CrmStageHistory`

### Entity-specific records to support later
- `Company`
- `OwnerOperator`
- `Shipper`
- existing `Broker` extended into CRM capability
- existing `Driver` extended into CRM capability

### Financial rollup hooks
Each CRM-capable entity should later support:
- `revenueIn`
- `paymentsOut`
- optional profitability or margin views

## Relationship Model Guidance
Do not collapse all freight participants into one generic table too early.

The better path is:
- shared CRM lifecycle framework
- dedicated business entities for each participant type
- reusable activity/task/tag infrastructure across all of them

That keeps the model expressive and operationally realistic.

## UI Surface Guidance
The CRM should eventually appear as a top-level operating area with separate views for:
- Brokers
- Drivers
- Companies
- Owner Operators
- Shippers

Each should have:
- list view
- record detail page
- lifecycle/status ribbon
- activity timeline
- document panel
- tasks/follow-ups
- revenue in / payments out summary

## Mobile Readiness Guidance
The CRM architecture should remain API-first so it can later support:
- mobile contact lookup
- task follow-up screens
- owner operator relationship notes
- field document access tied to CRM records

## Sequential Delivery Recommendation
The best future sequence after this planning step is:
1. CRM schema groundwork
2. Company / Owner Operator / Shipper entities
3. Shared lifecycle stage system
4. Revenue In / Payments Out rollups
5. Activity timeline and tasks
6. CRM list/detail UI surfaces



## v25 Schema Groundwork Implemented
The data model groundwork now includes:
- shared `CRMStage` enum for lifecycle tracking
- new first-class entities: `Company`, `OwnerOperator`, and `Shipper`
- CRM-oriented fields on `Driver` and `Broker`
- `Revenue In` and `Payments Out` on CRM records
- `CRMActivity` as a generic activity timeline foundation

This is schema groundwork only. UI, service, and workflow activation come later.


## v26 Progress
- Backend service groundwork implemented for Companies, Owner Operators, and Shippers.
- API endpoints added for CRUD-style lifecycle management and activation state changes.


## UI groundwork status
- Companies UI: list, detail, create, edit
- Owner Operators UI: list, detail, create, edit
- Shippers UI: list, detail, create, edit
- Next CRM step: activity timeline and follow-up tasks surface


## Shared CRM + Operations Entities
Brokers and Drivers are not separate CRM-only records. They are shared entities that should surface in both Operations and CRM. This preserves one source of truth for relationship stage, activity, financial metrics, and operational usage.


## Activity timeline groundwork
The CRM layer now includes a shared activity timeline surface and backend contract. This gives every major CRM record a place to track relationship activity, follow-up work, and commercial context without creating entity-specific timeline implementations.


## v29
- CRM activity timelines now emphasize open follow-ups, due today items, and overdue items with summary metrics, sorting, and stronger visual alerts.


## Implemented groundwork through v30
- Stage transitions are now intended to be auto-logged as CRM timeline events.
- Record creation and active/inactive lifecycle changes are now part of the CRM activity model.


## Quick Lifecycle Actions
- Company, Owner Operator, and Shipper records should support in-place lifecycle stage changes.
- Users should be able to log contact date and set short follow-up targets without opening full edit forms.

- v32 list views now surface pipeline health more clearly through stage badges, due follow-up filtering, and CRM summary counters.


## Broker and Driver Visibility Alignment
Brokers and Drivers remain shared records across Operations and CRM. Their list views now surface CRM stage and follow-up visibility using the same records rather than introducing duplicate CRM-only entities.


## v34 — CRM dashboard overview groundwork
- Added a dedicated CRM Overview surface at /crm.
- Added CRM overview API/service groundwork for cross-entity pipeline health, stage distribution, and due follow-up visibility.
- CRM sidebar now includes CRM Overview above entity list pages.


## v36
- CRM overview actionability refined with priority workflow cards, entity drill-down actions, and CRM list pages that can open with quick-filter state from overview links.

## v37 — CRM list-to-detail workflow refinement
- CRM list pages now preserve current filters and search state when opening detail and edit views via returnTo routing.
- CRM detail pages now include structured back-to-list actions, lifecycle/status badges, and summary strips for faster orientation after drill-down.
- Broker, driver, company, owner operator, and shipper detail surfaces were normalized to improve follow-up handling, related-record navigation, and load/context review.


## CRM governance linkage
CRM stages and related lifecycle dictionaries should ultimately be governed through the Super Admin schema registry so stage definitions, ordering, activation state, and archival behavior can be managed without unsafe hard-coded edits.
