Order Management¶
The Order Management feature handles the entire lifecycle of a customer order — from creation to fulfilment or cancellation. It is the starting point for the platform's core business flow and is closely connected with several other features.
Purpose¶
Order Management ensures that customer orders are consistently processed, tracked, and maintained across all systems. It acts as the central coordinator for order-related events and provides a single source of truth for order status.
Core functions
- :material-clipboard-plus: Create orders from a completed shopping cart
- :material-clipboard-text-clock: Track order status throughout the fulfilment pipeline
- :material-clipboard-edit: Update orders when changes occur (cancellations, modifications)
- :material-clipboard-check: Complete orders after successful delivery
- :material-clipboard-remove: Cancel orders when needed
Involved Services¶
| Service | Responsibility |
|---|---|
| zwerfkei-website | Customer-facing frontend for placing and viewing orders. |
| zwerfkei | Core order engine, product catalog management, and order state handling. |
| zwerfkei-backend | New backend that acts as a middleware layer between the website and the core engine. |
Process Flows¶
General process flow¶
The diagram below shows the general service interaction when an order is created and processed:
sequenceDiagram
actor Customer
participant Website as zwerfkei-website
participant Backend as zwerfkei-backend
participant Core as zwerfkei
Customer->>Website: Place order (checkout)
Website->>Backend: API call: create order
Backend->>Core: Create order from cart data
Core-->>Backend: Order created (order ID + status)
Backend-->>Website: Order confirmation
Website-->>Customer: Show order confirmation page
Customer->>Website: View order status
Website->>Backend: API call: get order details
Backend->>Core: Fetch order status
Core-->>Backend: Order details & status
Backend-->>Website: Order information
Website-->>Customer: Display order status
Future architecture
In the future, this architecture can be transformed for the Brekz platform. In that case, zwerfkei-website is replaced by brekz-website and zwerfkei-backend by brekz-backend, without a dependency on the zwerfkei core service.
Order lifecycle¶
The following diagram shows the possible states an order can go through:
Future architecture
In the future this mermaid should be the correct steps, right now the following mermaid is an example and can be modified to the likings.
stateDiagram-v2
[*] --> Created: Order placed
Created --> PaymentPending: Awaiting payment
PaymentPending --> Paid: Payment received
PaymentPending --> Cancelled: Payment failed / timeout
Paid --> Processing: Preparing for shipment
Processing --> Shipped: Package dispatched
Shipped --> Delivered: Package delivered
Delivered --> [*]
Created --> Cancelled: Customer cancellation
Paid --> Cancelled: Cancellation before shipment
Cancelled --> [*]
Order Management Subfeatures¶
Order creation¶
When a customer completes the checkout, the shopping cart is converted into an order. The order captures all product details, pricing, customer information, and shipping details at the moment of creation.
Order tracking¶
Customers can view the current status of their orders through the website. The status is updated as the order moves through the fulfilment pipeline.
Order cancellation¶
Orders can be cancelled by the customer or by the system under certain conditions (e.g. payment failure, stock issues). Cancellation rules depend on the current state of the order — for example, shipped orders cannot be cancelled.
Connection to other features¶
Order Management is closely connected to:
- Cart Process — The cart is the source of order creation
- Payment Process — Payment is triggered after order creation and determines whether the order can proceed