CRM Service Event Catalog
Version: 1.0 Date: December 2025
Overview
This document catalogs all events consumed and produced by the CRM service. Events are the primary mechanism for keeping the CRM in sync with source services (SCL, TeeTime, Messaging).
Quick Links
| Document | Description |
|---|---|
| SCL Events | Member, tier, and payment events |
| TeeTime Events | Player, booking, and competition events |
| Messaging Events | Contact, consent, and message events |
| CRM Events | Events produced by CRM service |
| Processing | Queue config, idempotency, monitoring |
Event Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ EVENT FLOW DIAGRAM │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ SOURCE SERVICES │ │
│ ├───────────────┬───────────────────┬───────────────────────────────┤ │
│ │ │ │ │ │
│ │ SCL Service │ TeeTime Service │ Messaging Service │ │
│ │ │ │ │ │
│ │ DomainOutbox │ DomainOutbox │ EventEmitter │ │
│ │ │ │ │ │
│ └───────┬───────┴─────────┬─────────┴───────────────┬───────────────┘ │
│ │ │ │ │
│ │ member.* │ player.* │ contact.* │
│ │ tier.* │ teetime.* │ message.* │
│ │ payment.* │ handicap.* │ consent.* │
│ │ │ competition.* │ campaign.* │
│ │ │ │ │
│ └─────────────────┼─────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────┐ │
│ │ REDIS / BULLMQ │ │
│ │ Queue: crm-events │ │
│ └─────────────────┬───────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────┐ │
│ │ CRM SERVICE │ │
│ ├─────────────────────────────────────┤ │
│ │ ┌─────────────────────────────┐ │ │
│ │ │ Event Processor │ │ │
│ │ │ ───────────────────── │ │ │
│ │ │ 1. Parse event │ │ │
│ │ │ 2. Resolve identity │ │ │
│ │ │ 3. Update profile │ │ │
│ │ │ 4. Create activity │ │ │
│ │ │ 5. Trigger scoring │ │ │
│ │ │ 6. Update segments │ │ │
│ │ └─────────────────────────────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ ┌─────────────────────────────┐ │ │
│ │ │ CRM Database │ │ │
│ │ └─────────────────────────────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ ┌─────────────────────────────┐ │ │
│ │ │ Outbound Events │ │ │
│ │ │ (crm.profile.*) │ │ │
│ │ └─────────────────────────────┘ │ │
│ └─────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Event Envelope
All events follow a standard envelope format:
interface CrmEvent {
// Envelope metadata
id: string; // Unique event ID (UUID)
type: string; // Event type (e.g., "scl.member.created")
version: string; // Schema version (e.g., "1.0")
timestamp: string; // ISO 8601 timestamp
correlationId?: string; // For tracing related events
// Routing
tenantId: string; // Tenant identifier
source: string; // Source service name
// Identity hints for resolution
identity: {
authUserId?: string; // IDP user ID
email?: string; // Email address
phoneNumber?: string; // E.164 phone
sclMemberId?: number; // SCL Member ID
teetimePlayerId?: string; // TeeTime Player ID
messagingContactId?: string; // Messaging Contact ID
externalIds?: Record<string, string>;
};
// Event-specific payload
payload: Record<string, unknown>;
// Optional metadata
metadata?: {
userId?: string; // User who triggered the event
ipAddress?: string;
userAgent?: string;
};
}
Event Summary
Consumed Events
| Source | Event Count | High Priority |
|---|---|---|
| SCL | 8 events | payment.failed, member.status.changed |
| TeeTime | 10 events | booking.noshow |
| Messaging | 11 events | contactPreference.updated, message.bounced |
Produced Events
| Type | Description |
|---|---|
crm.profile.* | Profile lifecycle events |
crm.segment.* | Segment membership changes |
crm.churn.* | Churn risk alerts |
See CRM Events for full details.
Event Processing
- Transport: Redis/BullMQ
- Queue:
crm-events - Retry Policy: Exponential backoff (1s, 2s, 4s)
- Dead Letter Queue: Failed events after 3 retries
- Idempotency: SyncLog deduplication by event ID
See Processing for configuration details.