Customer Profiles
The CustomerProfile is the central entity representing a single customer across all DigiWedge systems.
Profile Structure
interface CustomerProfile {
id: string; // CRM profile UUID
tenantUuid: string; // Canonical CRM tenant isolation key
tenantId?: string; // Legacy tenant slug during migration
// Identity Keys
authUserId?: string; // IDP user ID, unique inside the CRM tenant
email?: string; // Normalized email
phoneNumber?: string; // E.164 phone
// Cross-Service Links
sclMemberId?: string; // SCL.Member.id
teetimePlayerId?: string; // TeeTime.Player.id
messagingContactId?: string; // Messaging.Contact.id
// Profile Data
firstName?: string;
lastName?: string;
displayName?: string;
// CRM Data
status: CustomerStatus;
lifecycleStage: LifecycleStage;
tags: string[];
// Computed Scores
engagementScore?: number; // 0-100
churnRiskScore?: number; // 0-100
lifetimeValue?: number; // Cents
// Activity Metrics
lastActivityAt?: Date;
activityCount30d: number;
bookingCount30d: number;
// Golf Data (from TeeTime)
handicap?: number;
homeClubId?: string;
// Membership Data (from SCL)
membershipTier?: string;
membershipStatus?: string;
// Marketing Consent (from Messaging - READ ONLY)
emailOptIn: boolean;
smsOptIn: boolean;
pushOptIn: boolean;
whatsappOptIn: boolean;
}
Lifecycle Stages
| Stage | Description |
|---|---|
| SUBSCRIBER | Email contact only |
| LEAD | Showed interest |
| OPPORTUNITY | Qualified or engaged opportunity |
| CUSTOMER | Has transacted |
| ADVOCATE | Refers others or has high engagement |
Identity Resolution
The CRM automatically links records from different services using tenant-scoped identity resolution:
- authUserId - Exact match inside the CRM tenant (100% confidence)
- email - Normalized exact match inside the CRM tenant (95% confidence)
- phone - E.164 exact match inside the CRM tenant (85% confidence)
- email + phone - Combined tenant-scoped match (99% confidence)
Activity Timeline
Every customer has an activity timeline aggregating events from all services:
| Source | Events |
|---|---|
| SCL | Member created, tier changed, payments |
| TeeTime | Bookings, handicap updates, competitions |
| Messaging | Messages sent, opens, clicks |
| CRM | Notes, tags, campaign interactions |