system

Loyalty System

Internal system that calculates, stores and reverses customer loyalty points in response to order events.

SystemInternal

Overview

The Loyalty System turns orders into rewards. The Loyalty ServiceLoyalty ServiceServicev1.0.0Awards loyalty points when orders complete and reverses them when orders are cancelled. Owns the points ledger and custo...Publishesloyalty-points-earned, loyalty-points-reversedSubscribesorder-completed, order-cancelledOwnercustomer-platformMapRepoView docs 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 Order Management SystemOrder Management SystemSystemv1.0.0Internal system that is the source of truth for orders. It creates orders, tracks their lifecycle, and publishes events ...Ownerordering-platformMapView docs, updates balances 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 points events for the rest of the business.

Resource Diagram

The services and messages that make up this system.

What’s inside

ComponentTypeResponsibility
Loyalty ServiceLoyalty ServiceServicev1.0.0Awards loyalty points when orders complete and reverses them when orders are cancelled. Owns the points ledger and custo...Publishesloyalty-points-earned, loyalty-points-reversedSubscribesorder-completed, order-cancelledOwnercustomer-platformMapRepoView docsServiceAwards and reverses loyalty points and maintains balances.
Loyalty DatabaseLoyalty DatabaseContainerv1.0.0PostgreSQL database that holds the loyalty points ledger and each customer's points balance.Ownercustomer-platformMapView docsData storePoints ledger and customer balances.

Messages this system sends