Orders (v1.0.0)
Manages the lifecycle of customer orders in the BookWorm e-commerce system
Overview
The Ordering domain represents a strategic core domain within the BookWorm system, responsible for managing the complete lifecycle of customer orders from creation through fulfillment. Built on our microservices architecture, it embodies critical business capabilities that directly impact the organization’s competitive advantage.
Domain Characteristics
Bounded Context: The Ordering domain has a well-defined boundary with explicit integration points between its constituent services (Ordering, Basket, Finance, and Notification) through gRPC communication, managed via our API Gateway.
Service Architecture: The domain is composed of four specialized services:
- Ordering Service: Core service managing order lifecycle and state
- Basket Service: Handles shopping cart and item management
- Finance Service: Manages payment processing and financial transactions
- Notification Service: Handles customer communications and alerts
Event Sourcing: The domain implements event sourcing as its persistence mechanism following our event-driven CQRS pattern, storing the complete history of order-related events rather than just the current state. This approach provides a comprehensive audit trail and enables temporal queries and state reconstruction at any point in time.
Data Storage: Uses PostgreSQL as the primary database for transactional data and Redis for caching and session management.
Business Rules and Invariants
- Orders must contain at least one item to be submitted
- Order status transitions follow a predefined state machine (e.g., Placed -> Completed or Cancelled)
- Cancellation is only permitted before the “Shipped” status
- Price calculations and summaries are validated against business rules
- Basket items must be reserved before order confirmation
- Financial transactions must be atomic and consistent
The domain handles complex business scenarios like partial fulfillment, order modifications, and cancellations while maintaining consistency and enforcing business rules throughout the order lifecycle.
Architecture diagram
Entity Map
Messages for this domain
Sends messages (15)
Quickly find the message you need by searching for the name, type, or summary.Showing 1 to 4 of 15 results
Receives messages (34)
Quickly find the message you need by searching for the name, type, or summary.Showing 1 to 4 of 34 results
Ordering process (sequence diagram)
Loading graph...