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

Read the architecture guide →

Order Item

Child entity within an Order capturing a purchased book identifier, positive quantity, and locked checkout-time unit price.

Child Entity

Domain Role & Boundary

Order Item is a child Entity owned by the OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs 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. Persisted 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, it records a single purchased title, its quantity, and its immutable checkout-time unit price. It explicitly does not own live book titles, descriptions, or promotional pricing (owned by CatalogDomainv1.0.0CatalogCore BookWorm subdomain that makes books discoverable, purchasable, and consistently described across the customer journ...Ownercatalog-experience-teamDiagramOpen docs and referenced strictly by bookId).

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 RoleChild Entity (owned by OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs)
Identifier StrategyUUIDv7 generated at persistence
Persistence StoreOrdering relational database (order_items)
Deletion SemanticsCascade-deleted if parent is purged; hidden automatically when parent OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs is soft-deleted
Concurrency ControlGoverned by parent OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs aggregate concurrency token
PII / Data ClassificationInternal transactional record (non-PII)

Attributes & Constraints

NameTypeRequiredDescriptionReference
idUUIDrequiredGlobally unique UUIDv7 identifier for the order line item.—
orderIdUUIDrequiredIdentifier of the parent Order aggregate.
orderProperty: id
bookIdUUIDrequiredCross-context identifier of the Catalog Book purchased on this line.
bookProperty: id
quantityintegerrequiredPositive number of copies purchased (must be greater than zero).—
pricedecimalrequiredNon-negative per-unit price locked at checkout time.—
AttributeBusiness Rule / ConstraintSensitivity / Notes
orderIdRequired foreign key to parent OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs.Aggregate containment
bookIdRequired; unique per (bookId, orderId) so each book appears at most once per order.Cross-context ID reference
quantityRequired; must be strictly greater than zero (> 0).Domain invariant
priceRequired; must be non-negative (>= 0), snapshotted from CatalogDomainv1.0.0CatalogCore BookWorm subdomain that makes books discoverable, purchasable, and consistently described across the customer journ...Ownercatalog-experience-teamDiagramOpen docs at checkout.Immutable after creation

Domain Invariants & Lifecycle

  • Positive quantity: Zero or negative item quantities are rejected at creation.
  • Non-negative price snapshot: Unit prices must be zero or greater and remain immutable even when BookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docs prices later change in CatalogDomainv1.0.0CatalogCore BookWorm subdomain that makes books discoverable, purchasable, and consistently described across the customer journ...Ownercatalog-experience-teamDiagramOpen docs.
  • One line per book: An OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs cannot contain duplicate line items for the same bookId.
  • Parent visibility coupling: Order items have no independent lifecycle; soft-deleting the parent OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs excludes all of its items from standard queries.
Note

Order Item calculates its line subtotal (price * quantity), which the parent OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs sums to derive totalPrice.

Relationships & Associated Operations

CategoryResourceRole / Interaction
Parent AggregateOrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docsOwned child collection (orderItems)
Cross-Context ReferencesBookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docsReferenced strictly by bookId (no database foreign key)
Mutating CommandsCreate orderCommandv1.0.0Create orderCreates an Order for the authenticated Buyer using the current basket and Catalog pricing.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Delete orderCommandv1.0.0Delete orderSoft-deletes an Order by its identifier without changing its business status.Ownercommerce-fulfillment-teamSchemaDiagramOpen docsCreated atomically with the parent order; hidden on order soft-delete
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 docsIncluded as part of parent order projections