Skip to content
Event storming templates

Event Storm — Ride-Hailing Trip

Rider request, dispatch matching, trip and fare across four bounded contexts, with a driver cancellation event the model never causes.

Template previewEvent storming
Ride-hailing trip — request to receiptBounded contexts4Domain events7Event coverage85.7%Hotspots3Model smells1Domain eventCommandActorAggregatePolicyRead modelExternal systemHotspotRider app1 event · 1 command · 1 policy · 1 hotspotTrip requestDispatch2 events · 1 command · 1 policy · 1 hotspotMatchingTrip2 events · 2 commands · 1 policy · 0 hotspotsTripPayments2 events · 1 command · 0 policies · 1 hotspotFareRiderRequest rideRide requestedLive driver mapSurge is quotedbefore a driver ismatchedWhen ride requested,match driverDispatch engineMatch driverDriver matchedDriver cancelledMapping and ETAserviceTwo riders matched toone driver during anetwork splitWhen driver matched,start tripDriverStart tripTrip startedDriverEnd tripTrip endedDriver earningssummaryWhen trip ended,charge riderPayment serviceCharge riderFare chargedReceipt issuedCard networkTips are added afterthe receipt is issuedWorkshop checksEvents with no producing command1Driver cancelledCommands with no resulting event0noneCommands with no aggregate0noneAggregates with no events0nonePolicies with a missing trigger event0nonePolicies with a missing command0noneHotspots per context3Rider app 1 · Dispatch 1 · Payments 1Cross-context flows3Rider app → Dispatch · Dispatch → Trip · Trip → Payments

Make it your own.

title "Ride-hailing trip — request to receipt"

context "Rider app"
  actor Rider
  aggregate "Trip request"
  command "Request ride" by Rider on "Trip request"
  event "Ride requested" from "Request ride"
  readmodel "Live driver map"
  hotspot "Surge is quoted before a driver is matched"
  policy "When ride requested, match driver" then "Match driver"

context "Dispatch"
  aggregate Matching
  command "Match driver" by "Dispatch engine" on Matching
  event "Driver matched" from "Match driver"
  event "Driver cancelled"
  external "Mapping and ETA service"
  hotspot "Two riders matched to one driver during a network split"
  policy "When driver matched, start trip" then "Start trip"

context "Trip"
  aggregate Trip
  actor Driver
  command "Start trip" by Driver on Trip
  event "Trip started" from "Start trip"
  command "End trip" by Driver on Trip
  event "Trip ended" from "End trip"
  readmodel "Driver earnings summary"
  policy "When trip ended, charge rider" then "Charge rider"

context "Payments"
  aggregate Fare
  command "Charge rider" by "Payment service" on Fare
  event "Fare charged" from "Charge rider"
  event "Receipt issued" from "Charge rider"
  external "Card network"
  hotspot "Tips are added after the receipt is issued"