Domain Model
Domain Model
Canonical entities and how each source maps to them. Mutable document; the Gold schema in gold-star-schema.md is derived from this.
The canonical entity schemas are the unified contract that every
source's Silver mapping targets: one mapping routine per source object
(object_registry.mapping_ref), one contract version per
mapping (contract_version), additive changes within a
version, a new version when a column changes meaning. A new source adds
mappings; it never adds columns to a shared pipeline (principles BP-03
and AP-01). This is the Fabric form of the interface-per-provider
pattern: the interface is the Silver schema in Git, the implementations
are the mapping routines, the registry is the dependency container.
Canonical entities
| Entity | Meaning | Salesforce | HubSpot | Google Ads | Business key in Silver | Gold representation |
|---|---|---|---|---|---|---|
| Person | A human the business markets or sells to | Lead, Contact | Contact | — (click ids only) | (source, source_id); identity link on normalised
email |
dim_person_pseudo (tokenised),
bridge_person_source, fact_lead_funnel |
| Organisation | A company or account | Account | Company | Customer (advertiser account, different meaning) | (source, source_id) |
dim_account |
| Opportunity | A potential sale with stages | Opportunity (+ OpportunityHistory) | Deal (+ property history) | — | (source, source_id) |
fact_deal_stage_event,
dim_pipeline_stage |
| Campaign | A marketing initiative | Campaign | Marketing campaign, marketing email | Campaign | (source, source_id) |
dim_campaign (conformed, SCD2) |
| Campaign membership | Person ↔︎ campaign | CampaignMember | Contact list membership, email recipient | — | (source, campaign_id, person_id) |
fact_engagement |
| Ad hierarchy | Advertiser structure | — | — | Customer → Campaign → Ad group → Ad, Keyword; Budget | (customer_id, resource_name) |
dim_ad_group, dim_ad,
dim_keyword, dim_budget |
| Ad performance | Metrics per entity per day | — | — | Report rows by segments.date |
(customer_id, entity, date, segments) |
fact_ad_performance_daily,
fact_spend_daily |
| Engagement event | A person interacted | Task, Event (activity) | Email events (sent, open, click, bounce), form submission, page view, meeting, call | — | (source, event_id) |
fact_engagement (grain: event),
fact_form_submission |
| Conversion | A valued action attributed to an ad | — (via lead source) | — | Conversion action metrics; gclid on uploads |
(customer_id, conversion_action, date) |
fact_ad_conversions_daily,
dim_conversion_action |
| Owner / user | Employee acting in a source | User | Owner | change_event.user_email |
(source, user_id) |
dim_owner_team (team or role; tokenised user key) |
| Consent | Lawful-basis flags | — (custom) | Subscription status, GDPR consent properties | — | (person_id, subscription_type) |
flags on dim_person_pseudo |
| Business event | An important change detected by rules | derived | derived | derived | event_id |
business_event |
| Publication | A generated, signed-off, delivered report for a period, with pinned Gold versions and a supersedes chain | derived | derived | derived | publication_id |
control.publication_log (ADR
11) |
Naming: Gold and the event catalogue use deal as the
short name of the conformed Opportunity/Deal entity
(fact_deal_stage_event, deal.stage_changed).
"Lead" in the funnel sense (fact_lead_funnel,
lead.qualified) means a Person in a pre-opportunity
lifecycle stage in either CRM, not only the Salesforce Lead object.
Entity relationship (conceptual)
erDiagram
PERSON ||--o{ CAMPAIGN_MEMBERSHIP : "belongs to"
CAMPAIGN ||--o{ CAMPAIGN_MEMBERSHIP : "has"
PERSON ||--o{ ENGAGEMENT_EVENT : "performs"
CAMPAIGN ||--o{ ENGAGEMENT_EVENT : "attributed to"
ORGANISATION ||--o{ PERSON : "employs"
ORGANISATION ||--o{ OPPORTUNITY : "owns"
PERSON ||--o{ OPPORTUNITY : "contact for"
CAMPAIGN ||--o{ OPPORTUNITY : "sourced by"
AD_ACCOUNT ||--o{ CAMPAIGN : "runs"
CAMPAIGN ||--o{ AD_GROUP : "contains"
AD_GROUP ||--o{ AD : "contains"
AD_GROUP ||--o{ KEYWORD : "targets"
CAMPAIGN ||--o{ AD_PERFORMANCE_DAY : "measured by"
AD_GROUP ||--o{ AD_PERFORMANCE_DAY : "measured by"
AD_PERFORMANCE_DAY }o--|| CONVERSION_ACTION : "counts"
PERSON ||--o{ CONSENT : "has"
OWNER ||--o{ OPPORTUNITY : "owns"
Identity resolution rules
- Email normalised (trim, lower-case, remove dots in Gmail local part is not applied; plus-addressing kept) is the cross-source person link; the token in Gold is the vault token obtained by lookup-or-create on the normalised email (ADR 6).
- A person with no email is linked on the normalised phone number
where present (a secondary vault key, ADR
6); with neither, the person is keyed on
(source, source_id)and cannot be joined across sources. Both cases are counted in a data-quality metric. gclidcaptured on a Salesforce lead or HubSpot contact links the person to a Google Ads click; the click itself is not ingested (no API), so attribution is at campaign level through thegclid-bearing landing-page parameters captured in the CRM (utm_*,campaign_id).- Campaign conformance: a Gold campaign has one row per source
campaign; a
marketing_initiativeattribute groups campaigns across sources by naming convention or an explicit mapping table maintained by Marketing Operations.
⚠️ Requires stakeholder input: whether a cross-source campaign mapping exists today (naming convention, shared ids in UTM parameters) or must be created.
Volumes (assumed)
| Entity | Rows | Notes |
|---|---|---|
| Person (all sources) | 0.3–1 M in total | A stock, not a yearly flow: the intake assumes hundreds of thousands of HubSpot contacts and low millions of Salesforce rows across all core objects (intake); leads and contacts are largely the same people |
| Engagement events | 20–50 M a year | Email events are the bulk |
| Ad performance rows | 1–5 M a year | Depends on keyword-level reporting and account count |
| Opportunities and deals | < 0.5 M in total | |
| Business events | < 1 M a year |