Busflow Docs

Internal documentation portal

Skip to content
Reviewed 17 May 2026

Customer Intelligence Domain [future — Phase 3]

An event-sourced analytics domain enabling the 360° Customer Profile vision — behavioral aggregation, customer segmentation, and intelligent recommendations.

Hub: See domain-model.md for the bounded context map and cross-boundary integration surface.

NOTE

This context does not exist in Phase 1 or Phase 2. This section establishes its architectural intent and ensures the operational contexts emit the events it will consume. See ADR-021 for the full specification.


Planned Entities [TBD]

  • CustomerActivityLog: An event-sourced ledger recording all customer touchpoints across contexts — bookings, boardings, purchases, communications, cancellations, no-shows. Consumed from domain events emitted by Commerce, Operations, Communications, and Backoffice.
  • BehaviorAggregate: Materialized per-customer metrics computed from the activity log: lifetime_revenue, total_bookings, last_booking_at, preferred_seat_position, preferred_boarding_point, no_show_count, average_booking_lead_time.
  • CustomerSegment: Operator-definable cohort definitions for targeted marketing (e.g., "frequent Nordsee travelers", "high-value dormant customers", "repeat no-shows"). Supports both rule-based and ML-driven segmentation.
  • EngagementScore: Computed customer health metrics — NPS, satisfaction, churn risk — derived from communication response rates, booking recency, and feedback.
  • RecommendationModel: ML pipeline outputs for per-user suggestions ("you may like Ostsee 5-Tage") and collaborative filtering ("passengers who booked Nordsee also booked Bodensee").
  • ChannelPreference: Learned preferred communication channel per customer, fed back to Communications for optimal delivery routing.

Relationship to PersonProfile: PersonProfile (Backoffice) remains the identity anchor — name, contact info, dietary needs. Customer Intelligence reads it via PersonProfileUpdated events but never writes to it. CI exposes a CustomerInsight read model consumed by the Workspace UI alongside the profile, providing the full 360° view without coupling Backoffice to analytics logic.

Identity Anchor: CustomerProfile carries person_profile_id (soft FK to Backoffice PersonProfile). CI creates a CustomerProfile only when a PersonProfile exists — CI never creates identity, it only enriches existing identity.

Booker Attribution: BookingConfirmed events carry booker_profile_id. CI attributes lifetime_revenue, booking_count, and average_booking_lead_time to the booker's CustomerProfile, not to accompanying travelers. Travelers receive travel-specific metrics (preferred seat, boarding behavior, tour preferences).

Contact Filter Rule: CI event consumers discard communication events where the originating Contact has no person_profile_id link. Pre-booking journey tracking deferred to Phase 3 — if it proves valuable, the system can backfill via event replay.

See ADR-037 for the full identity model decision.


Aggregates [TBD]

Conceptual aggregate definitions — the system will refine these when designing the event-sourced architecture in Phase 3.

CustomerProfile

RoleEntity
RootCustomerProfile
ChildBehaviorAggregate (materialized metrics)
ChildEngagementScore (health metrics)
ChildChannelPreference (learned preferences)

Note: BehaviorAggregate, EngagementScore, and ChannelPreference are read-model projections computed from the event store (CustomerActivityLog). In the final event-sourced design, these may become independent read models rather than aggregate children. The aggregate boundary will be refined during Phase 3 implementation.

CustomerSegment

Single-entity aggregate. Operator-definable cohort definitions for targeted marketing.

RecommendationModel

Single-entity aggregate. ML pipeline output for per-user suggestions and collaborative filtering.

Internal documentation — Busflow