Orders
Read and cancel customer orders (GetOrder, GetTracking, CancelOrder) and list a shopper's order history (ListOrdersByShopper).
List a shopper's order history, newest first
ListOrdersByShopper. Keyset pagination: the page is ordered placedAt descending with the orderId as the ascending tiebreak, `limit` defaults to 100 and is at most 500, and `cursor` is the nextCursor of the previous page (opaque). A bad limit is 400 invalid-limit, an undecodable cursor is 400 invalid-cursor and any other query parameter is 400 unknown-query-parameter. An unknown shopper is 404 not-found; a shopper without orders is an empty page. The items never carry the ship-to address.
Get a customer order with its status and the promise per group
Returns the order without the ship-to address; the address is only on the restricted ship-to route.
Get the order's tracking view per shipment group and package
Served from the event-fed read model OrderTrackingView (delivery-promise, order-sourcing and shipping-and-tracking events) joined with the order's groups. A package scanned before its label or shipment event arrived is listed once the order is known. One composite view of a single order, bounded by the order's shipment groups, so it is not paginated.
Request the cancellation of every group that is not yet locked (creates a cancellation request)
CancelOrder is a request (G12, G25). Every group still PROMISED (no node locked yet) moves to CANCELLATION_REQUESTED and CustomerOrderCancelled is published through the outbox with those groupNos; locked, shipped and delivered groups are untouched. order-sourcing decides: FulfillmentCancelled makes the group CANCELLED (the order is CANCELLED once every group is), FulfillmentCancelRefused returns the group to fulfilment (the vendor ships; the shopper path becomes a return). Refused with 409 cancel-after-lock (ErrCancelAfterLock) when no group is unlocked. Repeating the request, or cancelling a CANCELLED order, returns the order unchanged and publishes nothing.