SR-031 — My Orders, Order Details & Shipment Tracking: System Requirements
Metadata
| Field | Value |
|---|---|
| System Name | ui-application — My Orders, Order Details & Track Shipment |
| Document ID | SR-2026-ORD-001 |
| Author | Engineering Team |
| Status | Implemented (gaps noted inline) |
Traces back to BRD-030. Builds on the checkout-completion flow specified in SR-014.
Functional Requirements
My Orders list (features/dashboard/order/my_orders)
FR-01 (Status-filtered order list, BR-01): The My Orders screen queries the MyOrders GraphQL field, served by shop-service, passing an optional status filter selected from a fixed tab set; a CancelledOrRefunded tab maps to a combined filter covering both the cancelled and refunded order statuses in one request, rather than two separate queries merged client-side.
FR-02 (Always-current fetch, BR-02): Every MyOrders query is issued with GraphQL FetchPolicy.networkOnly — the list never serves a cached response, so a status change that happened moments ago (e.g. an order just shipped) is reflected the next time the shopper opens or refreshes the list.
FR-03 (Pagination): The list is paginated; scrolling to the end of the currently loaded page triggers the next page’s MyOrders query with the same status filter, appending results rather than replacing them.
FR-04 (Per-order-tagged controller lifecycle): Each order row that owns its own GetX controller instance (for row-level actions) registers that controller with Get.lazyPut(..., tag: orderId) and disposes it by the same tag, so multiple rows rendered from the same controller class never collide into one shared, stale instance.
Order Details (features/dashboard/order/order_details)
FR-05 (Single-order detail fetch, BR-03): Opening an order calls the OrderDetail GraphQL field with that order’s identifier, also under FetchPolicy.networkOnly, so the detail screen never shows a status that’s already out of date by the time the shopper taps into it.
FR-06 (Full order composition, BR-03): The OrderDetail response assembles, in one call: the ordered line items, the shipping and billing address content, the resolved payment method display information, and the order’s current status — the shopper never has to leave the screen or trigger a second request to see any of these.
FR-07 (Address resolution via pii-service): shop-service’s order service resolves the shipping/billing address snapshot identifiers stored on the order by calling pii-service’s address-snapshot lookup directly — it does not route this resolution through order-service, even though order-service exposes its own equivalent lookup RPC. (See Architecture-00026 for why, and TD-2026-ORD-001 for the resulting unused RPC.)
FR-08 (Payment method enrichment with fallback): shop-service’s order service overlays a human-readable display name and description onto the order’s persisted payment method code by calling payment-service’s allowed-payment-methods lookup; if that lookup fails, or the stored code no longer matches any currently configured method, the screen falls back to the order’s own persisted values rather than failing the whole request.
FR-09 (Strict per-shopper ownership, BR-05): A request for an order that doesn’t exist, or that exists but belongs to a different shopper within the same tenant, returns the same “not found” result in both cases — order-service’s query layer does not distinguish the two outcomes to the caller, by design, so that probing an arbitrary order identifier cannot be used to learn whether it exists under someone else’s account.
FR-10 (List scoped to the requesting shopper): The order list query is unconditionally scoped to the authenticated shopper’s own identity; there is no code path by which one shopper’s MyOrders query can return another shopper’s orders, regardless of any filter parameter supplied.
Track Shipment (features/dashboard/order/order_tracking)
FR-11 (Dual-source tracking view, BR-04): The Track Shipment screen combines two independent data sources: a one-shot fetch of the order’s own detail (for the items/address/status context already described in FR-05–FR-06) and a separate live event stream carrying shipment-specific progress, rather than a single combined query.
FR-12 (Live shipment stream via shipment-service, BR-04): The live shipment progress stream is served by shipment-service over Server-Sent Events, scoped to the specific order, and is a distinct channel from order-service’s own saga-progress stream used during checkout — Track Shipment does not reuse that checkout-time stream.
FR-13 (Catch-up then subscribe): On opening the stream, the shopper immediately receives every courier-scan event already recorded for the order up to that point, then continues receiving new events live as they arrive — the shopper is never shown a gap between “what already happened” and “what happens next.”
FR-14 (Stream keep-alive): The stream sends a periodic heartbeat frame so a long-idle connection (no new scan events) is not mistaken by any intermediary for a dead connection and silently dropped.
FR-15 (Tenant-scoped stream authorization): Before opening the stream for a given order, shipment-service confirms the order exists for the requesting shopper’s tenant; a stream request for an order outside that tenant is refused rather than silently returning an empty stream.
Non-Functional Requirements
NFR-01 (Freshness over caching): Every screen in this feature prioritizes showing the order’s true current state over minimizing network calls — networkOnly is used consistently across the list, detail, and initial tracking fetch, in deliberate contrast to the cached-snapshot approach used elsewhere in checkout (see ADR-00047 Decision 3).
NFR-02 (Graceful degradation of enrichment, not of core data): A failure to enrich an order with payment-method display text (FR-08) must never prevent the order’s own core fields (items, status, address) from being shown — enrichment failures degrade gracefully to the persisted raw value, they never surface as a screen-level error.
NFR-03 (No cross-tenant/cross-shopper leakage): No response returned by any screen in this feature may ever expose another shopper’s order content or another tenant’s shipment data, under any input, including a guessed or enumerated identifier (BR-05).
NFR-04 (Stream resilience) — (Gap — Track Shipment’s SSE client has no automatic reconnect on a dropped connection; the shopper must manually leave and re-open the screen to resume live updates after a network interruption, see TD-2026-ORD-001).
NFR-05 (Multi-instance stream availability) — (Gap — shipment-service’s SSE broker holds in-flight subscriptions in-process with no cross-replica replay; if the service ever scales beyond one instance, a shopper’s stream connection can silently miss events delivered to a different instance, see TD-2026-ORD-001).
Related Documents
- BRD-030 — My Orders, Order Details & Shipment Tracking
- SR-014 — Checkout Completion, Payment & Fulfillment Spec
- ADR-00047 — Order Query and Tracking Channel Strategy for My Orders
- Architecture-00026 — My Orders, Order Details & Track Shipment Component Topology and Data Flow
- TD-2026-ORD-001 — My Orders, Order Details & Track Shipment Gaps
- My Orders — Walkthrough Overview
- order-service
- shop-service
- shipment-service