service
Promotion Service

Promotion Service

Evaluates promotion rules and calculates the discount that applies to a cart. Receives discount requests and publishes the calculated result.

Service

Overview

The Promotion Service is the heart of the Promotion System. It receives Calculate DiscountCalculate DiscountCommandv1.0.0Command to calculate the discount that applies to a cart. Ownershopping-platformSchemaMapView docs requests from the Cart SystemCart SystemSystemv1.0.0Internal system that owns the customer's shopping cart and the checkout flow. It is the source of truth for cart content...Ownershopping-platformMapView docs, evaluates the applicable rules from the Promotion DatabasePromotion DatabaseContainerv1.0.0PostgreSQL store of promotion and discount rules.MapView docs, and publishes a Discount CalculatedDiscount CalculatedEventv1.0.0Published when a discount has been calculated for a cart. Ownershopping-platformSchemaMapView docs event with the result.

Sends 1 message

The calculated discount, published as an event

Receives 1 message

Discount calculation requests

Responsibilities

AreaDescription
Discount calculationHandles Calculate DiscountCalculate DiscountCommandv1.0.0Command to calculate the discount that applies to a cart. Ownershopping-platformSchemaMapView docs and evaluates promotion rules.
RulesReads promotion and discount rules from the Promotion DatabasePromotion DatabaseContainerv1.0.0PostgreSQL store of promotion and discount rules.MapView docs.
Event publishingEmits Discount CalculatedDiscount CalculatedEventv1.0.0Published when a discount has been calculated for a cart. Ownershopping-platformSchemaMapView docs with the calculated result.

Architecture diagram

Messages for this service

Sends messages (1)

Quickly find the message you need by searching for the name, type, or summary.
NameVersionTypeSummary
Discount Calculated
v1.0.0eventPublished when a discount has been calculated for a cart.

Receives messages (1)

Quickly find the message you need by searching for the name, type, or summary.
NameVersionTypeSummary
Calculate Discount
v1.0.0commandCommand to calculate the discount that applies to a cart.
Event-driven architecture documentation: Acme Inc