Delivered status records delivery date/time
Why it matters
Without a deliveredAt timestamp, any query for fulfillment metrics — average time from ship to delivery, on-time delivery rate, SLA compliance — becomes impossible or relies on updatedAt, which gets overwritten by post-delivery events like refund requests. If the customer contacts support asking when their package arrived, the platform has no answer beyond 'the carrier said so'. Capturing delivery time at the moment the status transitions is a one-line write that prevents a permanent data gap — a gap that can never be filled after the fact.
Severity rationale
Low because delivery timestamp absence only affects reporting and display quality; the order flow itself continues correctly without it.
Remediation
Add a nullable deliveredAt column to your order model in prisma/schema.prisma and populate it in lib/orders/state-machine.ts alongside other lifecycle timestamps.
// prisma/schema.prisma addition:
// deliveredAt DateTime?
// In transitionOrder (lib/orders/state-machine.ts):
const timestampFields: Record<string, Date> = {}
if (newStatus === 'delivered') timestampFields.deliveredAt = new Date()
if (newStatus === 'shipped') timestampFields.shippedAt = new Date()
if (newStatus === 'confirmed') timestampFields.confirmedAt = new Date()
if (newStatus === 'cancelled') timestampFields.cancelledAt = new Date()
await db.orders.update({ where: { id: orderId }, data: { status: newStatus, ...timestampFields } })
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 · functional-correctness — Functional Correctness
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ecommerce-order-management·automated