CRM Example: Custom Customer Relationship Management
Demonstrates modeling a CRM domain with domain events, commands, aggregates, and read models. No JavaScript; semantic HTML only.
Overview
A CRM system typically tracks customers, leads, opportunities, accounts, and activities. This example shows a minimal domain model that supports creating customers, managing contacts, and progressing leads through a sales pipeline.
Domain Model
- Aggregates: Customer
- Entities: Customer, Account, Lead, Opportunity, Contact
- Domain Events: CustomerCreated, CustomerUpdated, LeadCreated, LeadConverted, OpportunityCreated
- Value Objects: Email, PhoneNumber, Address
Commands
- CreateCustomer
- UpdateCustomer
- CreateLead
- ConvertLeadToOpportunity
- CreateOpportunity
Read Models & Projections
- CustomerProfile
- OpportunitySummary
- ActivityFeed
Lifecycle Example
- Create a Customer with basic details
- Add Contacts and an Account
- Capture a Lead and convert to Opportunity
- Move Opportunity to Won/Lost with final status