Admin can filter orders by status, date range, or total amount
Why it matters
Search by identifier (handled by order-search) and structured filtering are complementary and both required. An admin who can find a specific order by ID but cannot filter to 'all pending orders from the last 7 days' cannot manage their queue proactively — they can only react to inbound support contacts. iso-25010:2011 operability requires that the system supports the work patterns of its operators. For order operations, that means at minimum: filter by status (to work a specific queue) and filter by date range (to find orders placed in a given period). Without server-side filtering, a client-side filter on a paginated list gives false confidence while silently excluding records off the first page.
Severity rationale
Low because the absence of structured filters degrades admin efficiency but does not prevent order processing — admins can still use search and pagination to manage orders manually.
Remediation
Add status, from, to, minTotal, and maxTotal filter parameters to the admin orders API at app/api/admin/orders/route.ts and apply them server-side.
// app/api/admin/orders/route.ts
const { searchParams } = new URL(req.url)
const status = searchParams.get('status')
const from = searchParams.get('from')
const to = searchParams.get('to')
const minTotal = searchParams.get('minTotal')
const maxTotal = searchParams.get('maxTotal')
const where: Prisma.OrderWhereInput = {}
if (status) where.status = status
if (from || to) where.createdAt = {
...(from ? { gte: new Date(from) } : {}),
...(to ? { lte: new Date(to) } : {}),
}
if (minTotal || maxTotal) where.total = {
...(minTotal ? { gte: parseInt(minTotal) } : {}),
...(maxTotal ? { lte: parseInt(maxTotal) } : {}),
}
Render a status dropdown and a date range picker in the admin orders UI, both wired to query parameters.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Order Management Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · operability — Operability — admin usability
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ecommerce-order-management·automated