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

Read the architecture guide →

Order change checklist

Pre-merge engineering checklist for Ordering API, Finance orchestration, persistence, and contract changes.

Architecture

Purpose & Scope

This checklist defines the mandatory contract, lifecycle, persistence, concurrency, and verification checks for engineers modifying 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 or 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 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 subdomain. Review it before merging changes to HTTP v1 routes, Kafka messages, Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs schemas, or Redis coordination.

Visual Reference

The visual below contrasts authoritative 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 status transitions with independent 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 saga states.

Loading graph...

Order Status and Finance Orchestration State Transitions

Core Invariants & Design Rules

  • Terminal status immutability: Only a New OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs can transition to Completed or Cancelled; terminal states can never reopen or switch.
  • Locked purchase snapshot: Each 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 stores BookId, a positive quantity, and checkout unit price (PriceSale ?? Price), with the order total equal to the sum of recorded line totals.
  • Authorization & rate-limit boundaries: Preserve Microsoft Entra ID customer and admin policies (ordering_read, ordering_write scopes, admin-only delete and summary endpoints) and PerUserRateLimit.
  • Privacy & correlation: Keep buyer street addresses and personal data out of routine logs and error payloads; correlate checkout and saga traces by OrderId and W3C trace context.
Warning

Do not conflate soft deletion or saga timeout with Order.Status = Cancelled. 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 docs soft-deletes the order while leaving Status as New, and Finance timeout exhaustion cancels only the finance-taskhub orchestration.

Boundaries & Guarantees

ConcernStrategy & GuaranteeFailure / Edge-Case BehaviorRelated Resources
PersistenceEF Core migrations in order-database use snake_case identifiers; Marten event streams and Wolverine outbox/inbox tables commit atomically with Order writes.Missing migrations or unaligned Marten event types break audit history (GET /api/v1/orders/{id}/history) and projections (OrderSummary, OrderSummaryView).order-database, order, buyer
Caching & Locksorder-create:{userId} (60s TTL) guards PostgreSQL Order writes; {METHOD}:{PATH}:{x-request-id} (3600s TTL) deduplicates POST/PATCH calls.Duplicate x-request-id returns 409 Conflict; unhandled exceptions or >= 500 responses clear the idempotency marker so clients can safely retry.order-cache, CreateOrder
MessagingOutbound events (UserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent, OrderStatusChangedToCancelIntegrationEvent) and inbound basket-cleanup commands are partitioned by OrderId and Pact-verified.Breaking CloudEvents schemas fail Ordering-Finance or Finance-Ordering Pact suites or route messages to <code>bookworm.{env}.ordering.dead-letter-queue</code>.<code>bookworm.{env}.ordering.user-checked-out</code>, <code>bookworm.{env}.ordering.order-status-change-to-complete</code>, <code>bookworm.{env}.ordering.order-status-change-to-cancel</code>, <code>bookworm.{env}.ordering.dead-letter-queue</code>
ConcurrencyBuyer-scoped distributed lock prevents concurrent checkout races; 24h Redis idempotency guard deduplicates inbound Kafka commands.Lock contention aborts the competing checkout attempt cleanly without creating duplicate orders.order-api, order-orchestration, adr-003-separate-order-status-from-finance-saga

Safe Change & Verification Checklist

Pre-merge verification workflow

  1. Verify HTTP v1 and gRPC consumer compatibility

    Update OpenAPI v1 metadata for any changes to /api/v1/orders, /api/v1/buyers, or /api/v1/dashboard, and confirm compatibility with Get basket over gRPCQueryv1.0.0Get basket over gRPCReturns the current basket through the basket.v1 gRPC contract.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs (Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs) and Get books over gRPCQueryv1.0.0Get books over gRPCReturns multiple Catalog books by identifier through the book.v1 gRPC contract.Ownercatalog-experience-teamSchemaDiagramOpen docs (Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs).

  2. Validate Kafka contracts and Pact suites

    Keep CloudEvents schemas partitioned by OrderId and verify both Ordering-Finance and Finance-Ordering Pact contracts for checkout, completion, cancellation, and basket-cleanup messages.

  3. Check lifecycle, snapshot, and persistence invariants

    Confirm New → Completed | Cancelled immutability, checkout price snapshotting, snake_case migrations in Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs, Marten projection compatibility, and x-request-id / order-create:{userId} guards.

  4. Run formatting, build, and test suites

    Execute mise run format, mise run build, and mise run test to verify Ordering unit tests, architecture tests, and Pact contract tests pass.