Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Order

Durable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle transitions.

Aggregate RootAggregate Root

Domain Role & Boundary

Order is the central Aggregate Root in the OrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs bounded context, representing an accepted customer purchase with its locked purchase-time Order ItemEntityv1.0.0Order ItemChild entity within an Order capturing a purchased book identifier, positive quantity, and locked checkout-time unit pri...Ownercommerce-fulfillment-teamOpen docs lines and authoritative lifecycle status. Owned by Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs (with post-checkout saga coordination by Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs), it records what was bought and at what price. It explicitly does not own pre-purchase mutable baskets (ShoppingDomainv1.0.0ShoppingCoordinates the customer basket and pre-purchase checkout intent, from selecting books through handing an accepted purch...Ownercommerce-fulfillment-teamDiagramOpen docs), live catalog metadata (CatalogDomainv1.0.0CatalogCore BookWorm subdomain that makes books discoverable, purchasable, and consistently described across the customer journ...Ownercatalog-experience-teamDiagramOpen docs), payment settlement, or email transport (PlatformDomainv1.0.0PlatformProvides cross-cutting capabilities for recurring scheduled triggers and durable, idempotent transactional email notific...Ownerplatform-engineering-teamDiagramOpen docs).

Entity Profile

PropertyValue
Bounded Context / DomainOrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs
Owning ServiceOrder APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs
DDD RoleAggregate Root
Identifier StrategyUUIDv7 generated at persistence
Persistence StoreOrdering relational database (orders) and event-sourced summary stream
Deletion SemanticsSoft-delete (isDeleted flag excludes deleted orders and items without altering status)
Concurrency ControlOptimistic concurrency via row version, paired with buyer-scoped distributed locks and idempotency keys
PII / Data ClassificationInternal transactional record (note may contain customer-provided free text)

Attributes & Constraints

NameTypeRequiredDescriptionReference
idUUIDrequiredGlobally unique UUIDv7 identifier for the order.—
buyerIdUUIDoptionalIdentifier of the Buyer who placed the order (nullable if the buyer profile is later deleted).
buyerProperty: id
statusstring
NewCompletedCancelled
requiredAuthoritative business lifecycle status owned by Ordering.—
notestringoptionalOptional customer delivery or order note (up to 500 characters).—
orderItemsorder-item[]requiredPurchase-time line items composing the order.
order-itemProperty: id
totalPricedecimalrequiredComputed sum of unit price multiplied by quantity across all order items.—
isDeletedbooleanrequiredSoft-delete marker independent of the order's business status.—
createdAtdatetimerequiredUTC timestamp when the order was placed.—
lastModifiedAtdatetimeoptionalUTC timestamp of the most recent modification.—
rowVersionstringrequiredPersistence-managed optimistic concurrency token.—
AttributeBusiness Rule / ConstraintSensitivity / Notes
buyerIdLinks to BuyerEntityv1.0.0BuyerRepresents a customer's ordering profile and delivery address within the Ordering bounded context.Ownercommerce-fulfillment-teamOpen docs; becomes null if the buyer profile is hard-deleted so accepted orders remain intact.Customer reference
statusStarts as New; transitions once to Completed or Cancelled.Authoritative lifecycle state
noteOptional free-text customer note, max 500 characters.May contain user-entered PII
totalPriceComputed dynamically as the sum of price * quantity across orderItems; not stored separately.Derived monetary total
isDeletedDefaults to false; hides the order and its items from standard queries when true.Independent of status

Domain Invariants & Lifecycle

Warning

If post-checkout basket cleanup fails after bounded retries, Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs issues a compensation command so Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs soft-deletes the order and suppresses confirmation emails.

Order Status Lifecycle

Loading graph...

Relationships & Associated Operations

CategoryResourceRole / Interaction
Related EntitiesBuyerEntityv1.0.0BuyerRepresents a customer's ordering profile and delivery address within the Ordering bounded context.Ownercommerce-fulfillment-teamOpen docs, Order ItemEntityv1.0.0Order ItemChild entity within an Order capturing a purchased book identifier, positive quantity, and locked checkout-time unit pri...Ownercommerce-fulfillment-teamOpen docsPlaced by a buyer; owns one or more purchase-time order items
Cross-Context ReferencesBookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docsReferenced indirectly via Order ItemEntityv1.0.0Order ItemChild entity within an Order capturing a purchased book identifier, positive quantity, and locked checkout-time unit pri...Ownercommerce-fulfillment-teamOpen docs bookId
Mutating CommandsCreate orderCommandv1.0.0Create orderCreates an Order for the authenticated Buyer using the current basket and Catalog pricing.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Complete orderCommandv1.0.0Complete orderMarks an existing Order as Completed when its current status is New.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Cancel orderCommandv1.0.0Cancel orderMarks an existing Order as Cancelled when its current status is New.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Delete orderCommandv1.0.0Delete orderSoft-deletes an Order by its identifier without changing its business status.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Handle basket deletion failedCommandv1.0.0Handle basket deletion failedReports Finance's failed basket-cleanup outcome so Order API can soft-delete the affected Order. Ownercommerce-fulfillment-teamSchemaDiagramOpen docsPlace, complete, cancel, or soft-delete/compensate an order
Read QueriesGet orderQueryv1.0.0Get orderReturns Order details, including the recorded item quantities and prices.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, List ordersQueryv1.0.0List ordersReturns Orders with pagination and optional status and Buyer filters.Ownercommerce-fulfillment-teamSchemaDiagramOpen docsRetrieve order details or filtered order history
Emitted EventsUser checked outEventv1.0.0User checked outReports that an Order was placed and its checkout details are ready for Finance coordination. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Order completedEventv1.0.0Order completedReports that an Order transitioned from New to Completed. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Order cancelledEventv1.0.0Order cancelledReports that an Order transitioned from New to Cancelled. Ownercommerce-fulfillment-teamSchemaDiagramOpen docsTrigger post-checkout saga and lifecycle email notifications