Skip to content

Order Lifecycle

Order Lifecycle is the domain that turns a draft cart into a confirmed commercial order, keeps that order reviewable and adjustable, and supports post-purchase recovery through returns, refunds, and tracking.

This first pass treats the domain as five connected layers:

  • cart-state behavior before confirmation
  • core order authoring and review
  • line-level commercial adjustments and recovery
  • return processing
  • post-purchase visibility and tracking

Status

  • [x] Domain overview written
  • [x] Subdomains reviewed
  • [x] Technical node pages linked
  • [x] End-user concept pages linked
  • [x] Task guides linked

Responsibility

This domain is responsible for:

  • representing both carts and confirmed orders on the same Order aggregate
  • storing order items, addresses, references, totals, and customer ownership
  • validating checkout readiness and cart notifications before confirmation
  • supporting admin review, calculation, confirmation, cancellation, duplication, and refund flows
  • recording operational returns, return items, fees, shipping lines, and completion state
  • exposing order history and tracking state to shoppers after purchase

Subdomains

  • Cart State And Checkout Readiness
    • Order with cart = true
    • cart_token
    • cart notifications
    • checkout readiness
  • Order Authoring And Review
    • Order
    • OrderItem
    • order comments
    • order actions
  • Commercial Adjustments And Recovery
    • OrderRisk
    • OrderDiscountLine
    • OrderItemDiscountLine
    • OrderRefund
    • folded tax and shipping review details on Order
  • Return Processing
    • OrderReturn
    • OrderReturnItem
    • OrderReturnFeeLine
    • OrderReturnShippingLine
  • Post-Purchase Visibility And Tracking
    • order history
    • order detail
    • tracking timeline
    • fulfillments as downstream shipped outputs

Classification Decisions

Standalone technical pages

Standalone end-user pages

Standalone task guides

Folded into parent pages for now

  • OrderShippingLine
    • owned primarily by Fulfillment & Shipping and folded here only as part of order review because it is the priced result of shipment selection rather than a primary authoring surface
  • OrderDiscountLine
    • folded into Order because operators experience it mainly through financial details and calculation
  • OrderItemDiscountLine
    • folded into Order Item and Order because it is a line-level money-adjustment record, not a first-pass authoring surface
  • OrderTaxLine
    • folded into Order because it is part of the total-calculation surface rather than a first-pass workflow owner
  • OrderRefund
    • folded into Order Return and Order because refunds are downstream financial outcomes rather than the main review surface
  • OrderRisk
    • folded into Order because it is a thin nested record with no packaged standalone review page in the shared admin UI
  • OrderReturnItem
    • folded into Order Return
  • OrderReturnFeeLine
    • folded into Order Return
  • OrderReturnShippingLine
    • folded into Order Return

Explicitly not getting standalone end-user concept pages in this pass

  • Cart

Cart behavior is documented through the technical Cart page and adjacent storefront workflows. Risk remains an internal review concept documented inside the technical Order page rather than as a customer-usable feature.

Evidence Highlights

Framework ownership

  • packages/framework/src/Models/Order.php
  • packages/framework/src/Models/OrderItem.php
  • packages/framework/src/Models/OrderReturn.php
  • packages/framework/src/Models/OrderRisk.php

Admin and operations surfaces

  • packages/admin/routes/web.php
  • packages/admin/src/Livewire/Admin/Orders
  • packages/admin/src/Livewire/Admin/Order
  • packages/framework/src/Http/Controllers/Api/Admin/OrdersController.php
  • packages/framework/src/Http/Controllers/Api/Admin/OrderReturnsController.php
  • packages/framework/src/Http/Controllers/Api/Admin/OrderRisksController.php

Storefront and shopper-visible surfaces

  • packages/storefront/routes/web.php
  • packages/storefront/src/Livewire/Storefront/Cart
  • packages/storefront/src/Livewire/Storefront/MyAccount/Orders
  • packages/storefront/src/Livewire/Storefront/MyAccount/Order
  • packages/framework/src/Http/Controllers/Api/Storefront/CartsController.php
  • packages/framework/src/Http/Controllers/Api/Storefront/OrdersController.php
  • packages/framework/src/Http/Controllers/Api/Storefront/TrackingController.php

Core behavior and automation

  • packages/framework/src/Actions/Order/CreateOrder.php
  • packages/framework/src/Actions/Order/UpdateOrder.php
  • packages/framework/src/Actions/Order/MarkAsConfirmed.php
  • packages/framework/src/Actions/Order/CancelOrder.php
  • packages/framework/src/Actions/Cart/ValidateCart.php
  • packages/framework/src/Actions/OrderReturn/CreateOrderReturn.php
  • packages/framework/src/Actions/OrderReturn/ConfirmOrderReturnItems.php
  • packages/framework/src/Actions/OrderReturn/ApproveOrderReturnItems.php
  • packages/framework/src/Actions/OrderReturn/CompleteOrderReturn.php
  • packages/framework/src/Actions/Order/TrackOrder.php
  • Cart is not a separate model in this repo. It is an Order record in cart state with cart = true and a cart_token.
  • Order is the commercial aggregate. OrderItem is the line-level commercial and fulfillment unit inside it.
  • OrderRisk is not the same thing as a cart validation notification. Risks are stored records folded into Order review; notifications are transient checkout blockers or warnings.
  • OrderReturn is an operational return workflow and refund precursor, not a shopper-facing returns portal page in the shared package.
  • Tracking is built from fulfillment-request progression and shipped fulfillments, not from the order record alone.

Priority Technical Pages

Priority End-User Pages

Priority Task Guides