service
Loyalty Service

Loyalty Service

Awards loyalty points when orders complete and reverses them when orders are cancelled. Owns the points ledger and customer balances.

Service

Overview

The Loyalty Service consumes Order CompletedOrder CompletedEventv1.0.0Published when an order has been fulfilled and completed. Ownerordering-platformSchemaMapView docs and Order CancelledOrder CancelledEventv1.0.0Published when an order has been cancelled. Ownerordering-platformSchemaMapView docs from the Ordering domain. It records points in the Loyalty DatabaseLoyalty DatabaseContainerv1.0.0PostgreSQL database that holds the loyalty points ledger and each customer's points balance.Ownercustomer-platformMapView docs and publishes Loyalty Points EarnedLoyalty Points EarnedEventv1.0.0Published when a customer earns loyalty points for a completed order. Ownercustomer-platformSchemaMapView docs or Loyalty Points ReversedLoyalty Points ReversedEventv1.0.0Published when loyalty points are removed from a customer because the order that earned them was cancelled. Ownercustomer-platformSchemaMapView docs so that promotions and customer notifications can react.

Responsibilities

AreaDescription
EarningAwards points on Order CompletedOrder CompletedEventv1.0.0Published when an order has been fulfilled and completed. Ownerordering-platformSchemaMapView docs and emits Loyalty Points EarnedLoyalty Points EarnedEventv1.0.0Published when a customer earns loyalty points for a completed order. Ownercustomer-platformSchemaMapView docs.
ReversalRemoves points on Order CancelledOrder CancelledEventv1.0.0Published when an order has been cancelled. Ownerordering-platformSchemaMapView docs and emits Loyalty Points ReversedLoyalty Points ReversedEventv1.0.0Published when loyalty points are removed from a customer because the order that earned them was cancelled. Ownercustomer-platformSchemaMapView docs.
PersistenceReads from and writes to the Loyalty DatabaseLoyalty DatabaseContainerv1.0.0PostgreSQL database that holds the loyalty points ledger and each customer's points balance.Ownercustomer-platformMapView docs.

Architecture diagram

Messages for this service

Sends messages (2)

Quickly find the message you need by searching for the name, type, or summary.
NameVersionTypeSummary
Loyalty Points Earned
v1.0.0eventPublished when a customer earns loyalty points for a completed order.
Loyalty Points Reversed
v1.0.0eventPublished when loyalty points are removed from a customer because the order that earned them was cancelled.

Receives messages (2)

Quickly find the message you need by searching for the name, type, or summary.
NameVersionTypeSummary
Order Completed
v1.0.0eventPublished when an order has been fulfilled and completed.
Order Cancelled
v1.0.0eventPublished when an order has been cancelled.
Event-driven architecture documentation: Acme Inc