Skip to content

URS-031 · Record all transactions with timestamps and user IDs

Title: Record all transactions with timestamps and user IDs Date: 2026-04-23T03:40:21.350Z Duration: 105.1s Overall Status: ✅ PASS

The system shall record all transactions (orders, edits, returns) with timestamps and user IDs.

Source: User_Requirement_Specifications_ZuriMED_DeviceFlow.xlsx — the run below proves the system meets this requirement.

Status: ✅ PASS

Each step below corresponds to one Playwright test that ran sequentially. Screenshots and video recordings provide visual evidence of the UI behaviour.

1. Step 1: Logged in as Bob Kauffman — ✅ PASS

Section titled “1. Step 1: Logged in as Bob Kauffman — ✅ PASS”

What this step proves:

Authenticates as Bob Kauffman (StellarTech sales rep), establishing the user identity that will be recorded against subsequent transactions.

Audit events generated by this step:

(Evidence matched by declared name — step timing not available or no events fell in window)

TimeTypeActionUserOrgPerformed
2026-04-23 03:40:24Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:40:28Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:40:59Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:28Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:37Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:47Zuser_loguser:loginmark.manufacturer@zurimed.comZuriMED

Screenshots:

step 01 logged in

Video recording:


What this step proves:

Submits the first bill-only order as Bob Kauffman. The system records the order in billing_orders with created_by_user_id and a server-side created_at timestamp.

Audit events generated by this step:

(Evidence scoped to step execution window: 2026-04-23T03:40:38.555Z → 2026-04-23T03:40:55.374Z)

TimeTypeActionUserOrgPerformed
2026-04-23 03:40:52Zdecisionbill_only_order.enqueue_upload_classificationbob.kauffman@stellartech.comZuriMEDno
2026-04-23 03:40:53Ztransactional_emailnew_bill_onlyStellarTech Medical Solutions

Emails triggered by this step:

(Evidence matched by declared name — step timing not available or no events fell in window)

Email 1: New Bill-Only Order - 4/22/2026 - ZuriMED BO-1

Template: New_Bill-Only_Order_-_4_22_2026_-_ZuriMED_BO-1

New Bill-Only Order - 4/22/2026 - ZuriMED BO-1

Email 2: New Bill-Only Order - 4/22/2026 - ZuriMED BO-2

Template: New_Bill-Only_Order_-_4_22_2026_-_ZuriMED_BO-2

New Bill-Only Order - 4/22/2026 - ZuriMED BO-2

Screenshots:

step 02 account selected

step 02 devices selected

step 02 documents

step 02 review

step 02 order submitted

Video recording:


What this step proves:

Submits a second bill-only order, demonstrating that each transaction is recorded independently with its own user ID and a distinct timestamp.

Audit events generated by this step:

(Evidence matched by declared name — step timing not available or no events fell in window)

TimeTypeActionUserOrgPerformed
2026-04-23 03:40:52Zdecisionbill_only_order.enqueue_upload_classificationbob.kauffman@stellartech.comZuriMEDno
2026-04-23 03:41:22Zdecisionbill_only_order.enqueue_upload_classificationbob.kauffman@stellartech.comZuriMEDno

Emails triggered by this step:

(Evidence matched by declared name — step timing not available or no events fell in window)

Email 1: New Bill-Only Order - 4/22/2026 - ZuriMED BO-1

Template: New_Bill-Only_Order_-_4_22_2026_-_ZuriMED_BO-1

New Bill-Only Order - 4/22/2026 - ZuriMED BO-1

Email 2: New Bill-Only Order - 4/22/2026 - ZuriMED BO-2

Template: New_Bill-Only_Order_-_4_22_2026_-_ZuriMED_BO-2

New Bill-Only Order - 4/22/2026 - ZuriMED BO-2

Screenshots:

step 03 second order submitted

Video recording:


4. Step 4: Billing list with recorded transactions — ✅ PASS

Section titled “4. Step 4: Billing list with recorded transactions — ✅ PASS”

What this step proves:

Views the billing list as Bob, confirming that the Submitter and Created columns expose the recorded user and timestamp for each transaction in the UI.

Screenshots:

step 04 billing list

Video recording:


What this step proves:

Views the returns list, confirming that the Created By and Created columns expose user and timestamp attribution for return transactions.

Screenshots:

step 05 returns list

Video recording:


6. Step 6a: Cross-user billing view — ✅ PASS

Section titled “6. Step 6a: Cross-user billing view — ✅ PASS”

What this step proves:

Logs in as Mark Manufacturer to verify that Bob’s order transactions are visible to a different authorized user with the original user attribution intact.

Audit events generated by this step:

(Evidence matched by declared name — step timing not available or no events fell in window)

TimeTypeActionUserOrgPerformed
2026-04-23 03:40:24Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:40:28Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:40:59Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:28Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:37Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:47Zuser_loguser:loginmark.manufacturer@zurimed.comZuriMED

Screenshots:

step 06 cross user billing

Video recording:


7. Step 6b: Cross-user returns view — ✅ PASS

Section titled “7. Step 6b: Cross-user returns view — ✅ PASS”

What this step proves:

As Mark Manufacturer, verifies that return transactions are also visible cross-user with Created By and Created columns showing the original submitter.

Screenshots:

step 06 cross user returns


8. Step 7: Combined transaction log — ✅ PASS

Section titled “8. Step 7: Combined transaction log — ✅ PASS”

What this step proves:

Renders a live query from billing_orders, inventory_transactions, audit_events, and returns tables, proving every recorded transaction has a user and timestamp.

Screenshots:

step 07 transaction log

Video recording:


The following SQL queries ran against the application database after the Playwright scenarios completed. Each query asserts a specific condition that proves the feature under test persisted its data correctly.

Bill-only orders recorded with user ID + timestamp — ✅ PASS

Section titled “Bill-only orders recorded with user ID + timestamp — ✅ PASS”

Assertion: 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
idorder_numberstatuscreated_by_user_idcreated_at
019db86d-21a6-74a3-8d9f-67abdfa5ad90BO-1submitted17b8c9d0-e1f2-3456-1234-5678901234562026-04-23T03:40:52.988Z
019db86d-934d-7cdc-88aa-3991c337a79cBO-2submitted17b8c9d0-e1f2-3456-1234-5678901234562026-04-23T03:41:22.105Z

Inventory transactions recorded with timestamp — ✅ PASS

Section titled “Inventory transactions recorded with timestamp — ✅ PASS”

Assertion: 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
idsource_typesource_idcreated_atdistributor_organization_idmanufacturer_organization_id
019db86d-21ad-75a3-b84c-afde6725568fbill_only_order019db86d-21a6-74a3-8d9f-67abdfa5ad902026-04-23T03:40:52.988Zb2c3d4e5-f6a7-8901-bcde-f12345678901NULL
019db86d-9350-7721-8240-903fbc5f9d40bill_only_order019db86d-934d-7cdc-88aa-3991c337a79c2026-04-23T03:41:22.105Zb2c3d4e5-f6a7-8901-bcde-f12345678901NULL

Inventory history records each change with a timestamp — ✅ PASS

Section titled “Inventory history records each change with a timestamp — ✅ PASS”

Assertion: 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
iditem_idquantityinfocreated_at
019db86d-21b5-736c-9727-918b7a2a0aa3fc040d7d-bd90-4c8b-bd18-f25925eee6462{"action":"removed","reason":"bill_only_order","bestEffort":true,"billingOrderId":"019db86d-21a6-74a3-8d9f-67abdfa5ad90","shortageQuantity":0,"requestedQuantity":2}2026-04-23T03:40:52.988Z
019db86d-21b5-736c-9727-918c1445c1ce8106a817-5ccb-4bcb-b312-38de2a4c973b3{"action":"removed","reason":"bill_only_order","bestEffort":true,"billingOrderId":"019db86d-21a6-74a3-8d9f-67abdfa5ad90","shortageQuantity":0,"requestedQuantity":3}2026-04-23T03:40:52.988Z
019db86d-9352-71ed-9975-11fd8d7ec39dfc040d7d-bd90-4c8b-bd18-f25925eee6461{"action":"removed","reason":"bill_only_order","bestEffort":true,"billingOrderId":"019db86d-934d-7cdc-88aa-3991c337a79c","shortageQuantity":0,"requestedQuantity":1}2026-04-23T03:41:22.105Z
019db86d-9352-71ed-9975-11fedfc060b48106a817-5ccb-4bcb-b312-38de2a4c973b1{"action":"removed","reason":"bill_only_order","bestEffort":true,"billingOrderId":"019db86d-934d-7cdc-88aa-3991c337a79c","shortageQuantity":0,"requestedQuantity":1}2026-04-23T03:41:22.105Z

Audit events recorded with user ID + timestamp — ✅ PASS

Section titled “Audit events recorded with user ID + timestamp — ✅ PASS”

Assertion: 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
idorganization_iduser_idevent_typeactionobject_idcreated_at
019db86c-b123-759c-a87e-3e8943060fc7b2c3d4e5-f6a7-8901-bcde-f1234567890117b8c9d0-e1f2-3456-1234-567890123456user_loguser:loginNULL2026-04-23T03:40:24.238Z
019db86c-c197-7359-80b3-bc5ef64946cbb2c3d4e5-f6a7-8901-bcde-f1234567890117b8c9d0-e1f2-3456-1234-567890123456user_loguser:loginNULL2026-04-23T03:40:28.447Z
019db86d-21ba-7786-a46c-811dbca686eaa1b2c3d4-e5f6-7890-abcd-ef123456789017b8c9d0-e1f2-3456-1234-567890123456decisionbill_only_order.enqueue_upload_classification019db86d-21a6-74a3-8d9f-67abdfa5ad902026-04-23T03:40:52.988Z
019db86d-2251-7781-9956-7273e8a616dcb2c3d4e5-f6a7-8901-bcde-f12345678901NULLtransactional_emailnew_bill_only019db86d-21a6-74a3-8d9f-67abdfa5ad902026-04-23T03:40:53.241Z
019db86d-3a1d-7744-a2bc-460c68e8f1a4b2c3d4e5-f6a7-8901-bcde-f1234567890117b8c9d0-e1f2-3456-1234-567890123456user_loguser:loginNULL2026-04-23T03:40:59.298Z
019db86d-9355-7617-9380-af41cc7dd6ffa1b2c3d4-e5f6-7890-abcd-ef123456789017b8c9d0-e1f2-3456-1234-567890123456decisionbill_only_order.enqueue_upload_classification019db86d-934d-7cdc-88aa-3991c337a79c2026-04-23T03:41:22.105Z
019db86d-9985-7b49-82c4-3890f4728cbfb2c3d4e5-f6a7-8901-bcde-f12345678901NULLtransactional_emailnew_bill_only019db86d-934d-7cdc-88aa-3991c337a79c2026-04-23T03:41:23.730Z
019db86d-ab6c-7c51-8bd5-2219bbcac632b2c3d4e5-f6a7-8901-bcde-f1234567890117b8c9d0-e1f2-3456-1234-567890123456user_loguser:loginNULL2026-04-23T03:41:28.319Z
019db86d-cea0-7777-b8c6-5d2260ba4d5ab2c3d4e5-f6a7-8901-bcde-f1234567890117b8c9d0-e1f2-3456-1234-567890123456user_loguser:loginNULL2026-04-23T03:41:37.323Z
019db86d-f48f-7101-8fa7-19c7c866ce29a1b2c3d4-e5f6-7890-abcd-ef1234567890d4e5f6a7-b8c9-0123-def1-234567890123user_loguser:loginNULL2026-04-23T03:41:47.031Z

Returns have created_by_user_id + created_at populated — ✅ PASS

Section titled “Returns have created_by_user_id + created_at populated — ✅ PASS”

Assertion: 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
idreturn_numberstatuscreated_by_user_idcreated_atcreated_by_email
ca000003-0000-4000-8000-000000000003ZRI-RET-2025-003submitted17b8c9d0-e1f2-3456-1234-5678901234562026-03-24T02:44:53.534Zbob.kauffman@stellartech.com
ca000002-0000-4000-8000-000000000002ZRI-RET-2025-002submitted28c9d0e1-f2a3-4567-2345-6789012345672026-04-09T02:44:53.534Zryan.delauintana@stellartech.com
ca000001-0000-4000-8000-000000000001ZRI-RET-2025-001submitted17b8c9d0-e1f2-3456-1234-5678901234562026-04-20T02:44:53.534Zbob.kauffman@stellartech.com

Inventory transactions timestamped at or after their triggering order — ✅ PASS

Section titled “Inventory transactions timestamped at or after their triggering order — ✅ PASS”

Assertion: 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_numberorder_created_atfirst_txn_created_at
BO-12026-04-23T03:40:52.988Z2026-04-23T03:40:52.988Z
BO-22026-04-23T03:41:22.105Z2026-04-23T03:41:22.105Z

Multiple distinct users represented across transactions — ✅ PASS

Section titled “Multiple distinct users represented across transactions — ✅ PASS”

Assertion: 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
d4e5f6a7-b8c9-0123-def1-234567890123

Per-declaration outcome of every expectedAuditActions and expectedEmailTemplates entry written into the orchestrator. Missing evidence here is a real test failure, not a soft warning.

Each row asserts that a declared expectedAuditActions entry produced a matching row in audit_events. A ❌ flips overall status to FAIL — the declaration is real proof, not just an annotation.

StepExpected Audit ActionFound
Step 1: Logged in as Bob Kauffmanuser_log:user:login
Step 2: First orderdecision:bill_only_order.enqueue_upload_classification
Step 3: Second orderdecision:bill_only_order.enqueue_upload_classification
Step 6: Cross-user billing viewuser_log:user:login

Each row asserts that a declared expectedEmailTemplates entry was matched (case-insensitive substring) by a captured email subject or template. A ❌ flips overall status to FAIL.

StepExpected TemplateFound
Step 2: First orderNew Bill-Only Order
Step 3: Second orderNew Bill-Only Order

Every row written to audit_events while this test was running (scoped to the demo organizations). Provides compliance evidence that user actions are traced end-to-end (URS-003).

Capture window start: 2026-04-23T03:40:19.452Z

SELECT
ae.created_at,
ae.event_type,
ae.action,
ae.user_id,
u.email AS user_email,
ae.organization_id,
o.name AS organization_name,
ae.object_id,
ae.secondary_object_id,
ae.payload,
ae.route,
ae.trace_id
FROM audit_events ae
LEFT JOIN users u ON u.id = ae.user_id
LEFT JOIN organizations o ON o.id = ae.organization_id
WHERE ae.created_at >= $1
AND ae.organization_id = ANY($2::uuid[])
ORDER BY ae.created_at ASC

10 event(s) captured:

TimeTypeActionUserOrgObject IDPerformedReason
2026-04-23 03:40:24Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:40:28Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:40:52Zdecisionbill_only_order.enqueue_upload_classificationbob.kauffman@stellartech.comZuriMED019db86d-21a6-74a3-8d9f-67abdfa5ad90noNo uploaded PO documents
2026-04-23 03:40:53Ztransactional_emailnew_bill_onlyStellarTech Medical Solutions019db86d-21a6-74a3-8d9f-67abdfa5ad90
2026-04-23 03:40:59Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:22Zdecisionbill_only_order.enqueue_upload_classificationbob.kauffman@stellartech.comZuriMED019db86d-934d-7cdc-88aa-3991c337a79cnoNo uploaded PO documents
2026-04-23 03:41:23Ztransactional_emailnew_bill_onlyStellarTech Medical Solutions019db86d-934d-7cdc-88aa-3991c337a79c
2026-04-23 03:41:28Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:37Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:47Zuser_loguser:loginmark.manufacturer@zurimed.comZuriMED

2 notification email(s) were captured during this test run. Each email is rendered as a screenshot for compliance review.

1. New Bill-Only Order - 4/22/2026 - ZuriMED BO-1

Section titled “1. New Bill-Only Order - 4/22/2026 - ZuriMED BO-1”

Template: New_Bill-Only_Order_-_4_22_2026_-_ZuriMED_BO-1

New Bill-Only Order - 4/22/2026 - ZuriMED BO-1

2. New Bill-Only Order - 4/22/2026 - ZuriMED BO-2

Section titled “2. New Bill-Only Order - 4/22/2026 - ZuriMED BO-2”

Template: New_Bill-Only_Order_-_4_22_2026_-_ZuriMED_BO-2

New Bill-Only Order - 4/22/2026 - ZuriMED BO-2