URS-031 · Record all transactions with timestamps and user IDs
Status: FAIL · Duration: 59s · Run Date: April 21, 2026
Test Scenarios
Section titled “Test Scenarios”Step 1: Logged in as Bob Kauffman
Section titled “Step 1: Logged in as Bob Kauffman”
Step 2: First order
Section titled “Step 2: First order”




Playwright execution
Section titled “Playwright execution”Recordings
Section titled “Recordings”step 01 login bob
Section titled “step 01 login bob”step 02 first order
Section titled “step 02 first order”Database Validations
Section titled “Database Validations”Bill-only orders recorded with user ID + timestamp
Section titled “Bill-only orders recorded with user ID + timestamp”At least two billing_orders created by Bob in the test window, each with created_by_user_id and created_at populated
SELECT id, order_number, status, created_by_user_id, created_at FROM billing_orders WHERE created_by_user_id = $1 AND created_at > NOW() - INTERVAL '30 minutes' ORDER BY created_at ASC| id | order_number | status | created_by_user_id | created_at |
|---|---|---|---|---|
| 019dadea-e361-757f-b22c-3d61e95c00bd | BO-1 | submitted | 17b8c9d0-e1f2-3456-1234-567890123456 | 2026-04-21T02:42:25.231Z |
Inventory transactions recorded with timestamp
Section titled “Inventory transactions recorded with timestamp”inventory_transactions rows exist for the bill-only orders, each with a non-null created_at
SELECT id, source_type, source_id, created_at, distributor_organization_id, manufacturer_organization_id FROM inventory_transactions WHERE source_type = 'bill_only_order' AND created_at > NOW() - INTERVAL '30 minutes' AND (distributor_organization_id = $1 OR manufacturer_organization_id = $1) ORDER BY created_at ASC| id | source_type | source_id | created_at | distributor_organization_id | manufacturer_organization_id |
|---|---|---|---|---|---|
| 019dadea-e365-7b6f-a788-441b1e159b1e | bill_only_order | 019dadea-e361-757f-b22c-3d61e95c00bd | 2026-04-21T02:42:25.231Z | b2c3d4e5-f6a7-8901-bcde-f12345678901 |
Inventory history records each change with a timestamp
Section titled “Inventory history records each change with a timestamp”inventory_history contains bill_only_order rows in the test window, each with created_at populated
SELECT ih.id, ih.item_id, ih.quantity, ih.info, ih.created_at FROM inventory_history ih WHERE ih.created_at > NOW() - INTERVAL '30 minutes' AND ih.info->>'reason' = 'bill_only_order' ORDER BY ih.created_at ASC LIMIT 20| id | item_id | quantity | info | created_at |
|---|---|---|---|---|
| 019dadea-e367-77ae-a907-cacf83430621 | 4ec9562d-982c-4070-ac02-c2336e26f460 | 2 | [object Object] | 2026-04-21T02:42:25.231Z |
| 019dadea-e367-77ae-a907-cad0e98a8b8e | 3ec46943-c392-433d-b94f-adab3c6492d5 | 3 | [object Object] | 2026-04-21T02:42:25.231Z |
Audit events recorded with user ID + timestamp
Section titled “Audit events recorded with user ID + timestamp”At least one audit_events row in the test window has both user_id and created_at populated, and no row is missing created_at
SELECT id, organization_id, user_id, event_type, action, object_id, created_at FROM audit_events WHERE created_at > NOW() - INTERVAL '30 minutes' AND organization_id IN ($1, $2) ORDER BY created_at ASC LIMIT 50| id | organization_id | user_id | event_type | action | object_id | created_at |
|---|---|---|---|---|---|---|
| 019dadea-78ec-7b0e-aff5-fa705b60f155 | b2c3d4e5-f6a7-8901-bcde-f12345678901 | 17b8c9d0-e1f2-3456-1234-567890123456 | user_log | user:login | 2026-04-21T02:41:58.003Z | |
| 019dadea-8846-7c27-8026-640c22969902 | b2c3d4e5-f6a7-8901-bcde-f12345678901 | 17b8c9d0-e1f2-3456-1234-567890123456 | user_log | user:login | 2026-04-21T02:42:01.930Z | |
| 019dadea-e369-75b7-a60a-af4ca1040492 | a1b2c3d4-e5f6-7890-abcd-ef1234567890 | 17b8c9d0-e1f2-3456-1234-567890123456 | decision | bill_only_order.enqueue_upload_classification | 019dadea-e361-757f-b22c-3d61e95c00bd | 2026-04-21T02:42:25.231Z |
| 019dadea-fad5-7669-bfe3-c846ff5e3d1c | b2c3d4e5-f6a7-8901-bcde-f12345678901 | 17b8c9d0-e1f2-3456-1234-567890123456 | user_log | user:login | 2026-04-21T02:42:31.257Z |
Returns have created_by_user_id + created_at populated
Section titled “Returns have created_by_user_id + created_at populated”All pre-seeded returns (and any created during the test) have non-null created_by_user_id and created_at
SELECT r.id, r.return_number, r.status, r.created_by_user_id, r.created_at, u.email AS created_by_email FROM returns r LEFT JOIN users u ON u.id = r.created_by_user_id WHERE r.return_number = ANY($1) OR r.created_at > NOW() - INTERVAL '30 minutes' ORDER BY r.created_at ASC| id | return_number | status | created_by_user_id | created_at | created_by_email |
|---|---|---|---|---|---|
| ca000003-0000-4000-8000-000000000003 | ZRI-RET-2025-003 | submitted | 17b8c9d0-e1f2-3456-1234-567890123456 | 2026-03-22T02:18:14.976Z | bob.kauffman@stellartech.com |
| ca000002-0000-4000-8000-000000000002 | ZRI-RET-2025-002 | submitted | 28c9d0e1-f2a3-4567-2345-678901234567 | 2026-04-07T02:18:14.976Z | ryan.delauintana@stellartech.com |
| ca000001-0000-4000-8000-000000000001 | ZRI-RET-2025-001 | submitted | 17b8c9d0-e1f2-3456-1234-567890123456 | 2026-04-18T02:18:14.976Z | bob.kauffman@stellartech.com |
Inventory transactions timestamped at or after their triggering order
Section titled “Inventory transactions timestamped at or after their triggering order”For every bill-only order in the test window, the earliest inventory_transaction linked to it has created_at >= billing_order.created_at
SELECT bo.order_number, bo.created_at AS order_created_at, MIN(it.created_at) AS first_txn_created_at FROM billing_orders bo JOIN inventory_transactions it ON it.source_type = 'bill_only_order' AND it.source_id = bo.id WHERE bo.created_by_user_id = $1 AND bo.created_at > NOW() - INTERVAL '30 minutes' GROUP BY bo.id, bo.order_number, bo.created_at| order_number | order_created_at | first_txn_created_at |
|---|---|---|
| BO-1 | 2026-04-21T02:42:25.231Z | 2026-04-21T02:42:25.231Z |
Multiple distinct users represented across transactions
Section titled “Multiple distinct users represented across transactions”The combined transaction set (orders, returns, audit events) contains at least two distinct user IDs
SELECT DISTINCT user_id FROM ( SELECT created_by_user_id AS user_id FROM billing_orders WHERE created_at > NOW() - INTERVAL '30 minutes' AND created_by_user_id IS NOT NULL UNION SELECT created_by_user_id AS user_id FROM returns WHERE return_number = ANY($1) UNION SELECT user_id FROM audit_events WHERE created_at > NOW() - INTERVAL '30 minutes' AND user_id IS NOT NULL ) u ORDER BY user_id| user_id |
|---|
| 17b8c9d0-e1f2-3456-1234-567890123456 |
| 28c9d0e1-f2a3-4567-2345-678901234567 |