---
id: JNY-COM-ORD-003
title: A manager locates a purchase and reviews its balance
feature: FEAT-COM-ORD-03
product_area: commerce
module: orders
revision: 1
status: draft
product_intent: confirmed
implementation_evidence: observed
supersedes:
  - COM-ACC-0853
  - COM-ACC-0854
  - COM-ACC-0855
  - COM-ACC-0867
  - COM-ACC-0861
  - COM-ACC-0036
  - COM-ACC-0037
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
actor: ACT-COM-015
goal: Locate a customer purchase without knowing its order number and determine whether an amount remains due.
capabilities:
  - CAP-COM-ORD-010
  - CAP-COM-ORD-011
screens:
  - '/console/{tenantId}/orders'
  - '/console/{tenantId}/orders/{orderId}'
steps:
  - 'n': 1
    surface: '/console/{tenantId}/orders'
    action: Choose Orders within Orders and Inventory.
    capability: CAP-COM-ORD-010
    expected: 'The paged table presents recent purchases first, including the customer, state, total and balance.'
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#lists
      every order of the tenant newest placed first, and none of another tenant’s
  - 'n': 2
    surface: listOrders
    action: Enter a fragment of the customer’s name.
    capability: CAP-COM-ORD-010
    expected: Name matching finds the customer’s purchases regardless of case.
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#finds
      an order by part of its buyer’s name in any case
  - 'n': 3
    surface: listOrders
    action: Apply the Unpaid view and the preceding week’s date range.
    capability: CAP-COM-ORD-010
    expected: Results include owing or unbilled purchases within the dates and exclude voided ones.
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#filters
      the unpaid orders: owing or not yet billed, never a voided one
  - 'n': 4
    surface: '/console/{tenantId}/orders/{orderId}'
    action: Follow the order number into its detail view.
    capability: CAP-COM-ORD-010
    expected: The money panel presents the supplied Accounting position and a link to the associated invoice.
    provenance: test
    source: >-
      react-console:components/console/order/__tests__/order-360-live-cards.test.tsx#shows the totals with the
      promotion's name, the money, and the invoice as a link to Accounting
alternates:
  - from_step: 2
    condition: The manager knows the order number
    path: Search the number with or without its display prefix
    outcome: The matching purchase appears
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#finds
      an order by its display number with or without the ORD- prefix
failures:
  - from_step: 1
    condition: The caller lacks permission to read orders
    path: Refuse the order-list request
    outcome: The request does not disclose order data
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/checkout-security.e2e.spec.js#refuses a caller without
      commerce.orders.read the list, 403 permission_missing
rules_in_play:
  - BR-CAP-COM-ORD-010-01
  - BR-CAP-COM-ORD-010-02
  - BR-CAP-COM-ORD-010-03
  - BR-CAP-COM-ORD-010-06
  - BR-CAP-COM-ORD-010-07
  - BR-CAP-COM-ORD-010-08
  - BR-CAP-COM-ORD-011-02
assertions:
  - id: AS-JNY-COM-ORD-003-01
    statement: Pagination presents the purchases in newest-first order without omissions or duplicate rows.
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#pages
      with a limit and says whether another page follows
  - id: AS-JNY-COM-ORD-003-02
    statement: Search supports the display number and case-insensitive customer-name fragments.
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#finds
      an order by part of its buyer’s name in any case
  - id: AS-JNY-COM-ORD-003-03
    statement: The balance displayed in the table is the balance provided in its order data.
    provenance: test
    source: >-
      react-console:components/commerce/orders/__tests__/orders-list-screen.test.tsx#shows the number, the
      customer, the status, the total and the balance due
e2e_policy: required
e2e_reason: >-
  A browser journey must connect the live list, filters and detail view after refresh to prove staff can find
  an existing purchase again.
evidence:
  - >-
    Examined reference: react-console:components/commerce/orders/__tests__/orders-list-screen.test.tsx#shows
    the number, the customer, the status, the total and the balance due
  - >-
    Examined reference: react-console:components/console/order/__tests__/order-360-live-cards.test.tsx#shows
    the totals with the promotion's name, the money, and the invoice as a link to Accounting
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/checkout-security.e2e.spec.js#refuses a
    caller without commerce.orders.read the list, 403 permission_missing
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#filters
    the unpaid orders: owing or not yet billed, never a voided one
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#finds
    an order by its display number with or without the ORD- prefix
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#finds
    an order by part of its buyer’s name in any case
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#lists
    every order of the tenant newest placed first, and none of another tenant’s
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#pages
    with a limit and says whether another page follows
proved_by: []
---
# A manager locates a purchase and reviews its balance

## Story

A manager remembers the customer but lacks the order number. They search the Orders table, narrow the dates and use the Unpaid view to locate the purchase. Following the result opens the order, where the manager can inspect its balance and Accounting invoice link.
