Skip to content

URS-028 · Initiate Return Requests for Products

Title: Initiate Return Requests for Products Date: 2026-04-23T03:39:16.900Z Duration: 125.8s Overall Status: ✅ PASS

The system shall support initiating return requests for products.

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: Navigate to returns — ✅ PASS

Section titled “1. Step 1: Navigate to returns — ✅ PASS”

What this step proves:

A sales rep navigates to the returns section of the application. This verifies the returns feature is accessible and that the navigation flow works correctly.

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:39:19Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:39:28Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:40:23Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:11Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions

Screenshots:

step 01 logged in

step 01 returns list

Video recording:


What this step proves:

The sales rep fills out the multi-step return request form with product and return reason details. This verifies all required fields are present and that form data can be entered correctly.

Screenshots:

step 02 new return form

step 02 account selected

step 02 event details

step 02 products selected

step 02 questions answered

step 02 locations selected

step 02 review

Video recording:


What this step proves:

The completed return form is submitted. This verifies the system accepts the return request and processes the submission through the multi-step form flow.

Screenshots:

step 03 review before submit

step 03 return submitted

Video recording:


4. Step 4: Verify return recorded — ✅ PASS

Section titled “4. Step 4: Verify return recorded — ✅ PASS”

What this step proves:

The submitted return request is confirmed to appear in the returns list. This verifies the return data was persisted correctly and is visible to the requesting user, satisfying the requirement that return requests can be initiated and tracked.

Screenshots:

step 04 returns list with return

step 04 return detail

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.

Assertion: At least one return should have been created by Bob Kauffman in the last 30 minutes

SELECT r.id, r.return_number, r.status, r.date_of_event,
r.sales_account_id, r.manufacturer_organization_id,
r.sales_organization_id, r.reporting_user_id,
r.return_location_id, r.replacement_location_id,
r.created_at, r.created_by_user_id
FROM returns r
WHERE r.created_by_user_id = $1
AND r.created_at > NOW() - INTERVAL '30 minutes'
ORDER BY r.created_at DESC
LIMIT 5
idreturn_numberstatusdate_of_eventsales_account_idmanufacturer_organization_idsales_organization_idreporting_user_idreturn_location_idreplacement_location_idcreated_atcreated_by_user_id
019db86d-5647-7f7e-bb24-ffa7f6fee9e0RET-1submitted2026-04-22T05:00:00.000Zfea7b8c9-d0e1-2345-0123-456789012345a1b2c3d4-e5f6-7890-abcd-ef1234567890b2c3d4e5-f6a7-8901-bcde-f1234567890117b8c9d0-e1f2-3456-1234-5678901234566ea3b4c5-d6e7-8901-6789-0123456789016ea3b4c5-d6e7-8901-6789-0123456789012026-04-23T03:41:06.484Z17b8c9d0-e1f2-3456-1234-567890123456

Assertion: Return should have a return number matching /^RET-\d+$/

SELECT r.id, r.return_number
FROM returns r
WHERE r.created_by_user_id = $1
AND r.created_at > NOW() - INTERVAL '30 minutes'
AND r.return_number IS NOT NULL
AND r.return_number != ''
ORDER BY r.created_at DESC
LIMIT 1
idreturn_number
019db86d-5647-7f7e-bb24-ffa7f6fee9e0RET-1

Assertion: Return status should be “submitted”

SELECT r.id, r.return_number, r.status
FROM returns r
WHERE r.created_by_user_id = $1
AND r.created_at > NOW() - INTERVAL '30 minutes'
ORDER BY r.created_at DESC
LIMIT 1
idreturn_numberstatus
019db86d-5647-7f7e-bb24-ffa7f6fee9e0RET-1submitted

Assertion: At least one return item should exist for the submitted return

SELECT ri.id, ri.return_id, ri.product_id, ri.lot_number,
ri.return_item_number, op.title as product_name
FROM return_items ri
JOIN returns r ON ri.return_id = r.id
JOIN org_products op ON ri.product_id = op.id
WHERE r.created_by_user_id = $1
AND r.created_at > NOW() - INTERVAL '30 minutes'
ORDER BY r.created_at DESC, ri.created_at DESC
idreturn_idproduct_idlot_numberreturn_item_numberproduct_name
019db86d-5649-72e7-a93c-84c52d27f0ce019db86d-5647-7f7e-bb24-ffa7f6fee9e001989ca2-6a54-7834-8376-06a0251bacd8URS028-RETURN-001RET-1-SP019N1A-1SpeedPatch® PET

Return item has correct lot number — ✅ PASS

Section titled “Return item has correct lot number — ✅ PASS”

Assertion: Return item should have lot number “URS028-RETURN-001”

SELECT ri.id, ri.lot_number, ri.return_item_number
FROM return_items ri
JOIN returns r ON ri.return_id = r.id
WHERE r.created_by_user_id = $1
AND r.created_at > NOW() - INTERVAL '30 minutes'
AND ri.lot_number = $2
LIMIT 1
idlot_numberreturn_item_number
019db86d-5649-72e7-a93c-84c52d27f0ceURS028-RETURN-001RET-1-SP019N1A-1

Return linked to correct organizations — ✅ PASS

Section titled “Return linked to correct organizations — ✅ PASS”

Assertion: Return should be linked to ZuriMED (manufacturer) and StellarTech (distributor)

SELECT r.id, r.return_number,
r.manufacturer_organization_id, mo.name as manufacturer_name,
r.sales_organization_id, so.name as sales_org_name
FROM returns r
JOIN organizations mo ON r.manufacturer_organization_id = mo.id
JOIN organizations so ON r.sales_organization_id = so.id
WHERE r.created_by_user_id = $1
AND r.created_at > NOW() - INTERVAL '30 minutes'
ORDER BY r.created_at DESC
LIMIT 1
idreturn_numbermanufacturer_organization_idmanufacturer_namesales_organization_idsales_org_name
019db86d-5647-7f7e-bb24-ffa7f6fee9e0RET-1a1b2c3d4-e5f6-7890-abcd-ef1234567890ZuriMEDb2c3d4e5-f6a7-8901-bcde-f12345678901StellarTech Medical Solutions

Assertion: Return should have both return and replacement locations set

SELECT r.id, r.return_number,
r.return_location_id, rl.name as return_location_name,
r.replacement_location_id, repl.name as replacement_location_name
FROM returns r
JOIN real_world_locations rl ON r.return_location_id = rl.id
JOIN real_world_locations repl ON r.replacement_location_id = repl.id
WHERE r.created_by_user_id = $1
AND r.created_at > NOW() - INTERVAL '30 minutes'
ORDER BY r.created_at DESC
LIMIT 1
idreturn_numberreturn_location_idreturn_location_namereplacement_location_idreplacement_location_name
019db86d-5647-7f7e-bb24-ffa7f6fee9e0RET-16ea3b4c5-d6e7-8901-6789-012345678901BOSS - Shipping6ea3b4c5-d6e7-8901-6789-012345678901BOSS - Shipping

Return has reporting and created_by users — ✅ PASS

Section titled “Return has reporting and created_by users — ✅ PASS”

Assertion: Return should have both reporting_user_id and created_by_user_id set

SELECT r.id, r.return_number, r.reporting_user_id, r.created_by_user_id,
u1.name as reporting_user_name, u2.name as created_by_user_name
FROM returns r
JOIN users u1 ON r.reporting_user_id = u1.id
JOIN users u2 ON r.created_by_user_id = u2.id
WHERE r.created_by_user_id = $1
AND r.created_at > NOW() - INTERVAL '30 minutes'
ORDER BY r.created_at DESC
LIMIT 1
idreturn_numberreporting_user_idcreated_by_user_idreporting_user_namecreated_by_user_name
019db86d-5647-7f7e-bb24-ffa7f6fee9e0RET-117b8c9d0-e1f2-3456-1234-56789012345617b8c9d0-e1f2-3456-1234-567890123456Bob KauffmanBob Kauffman

Return item question response persisted — ✅ PASS

Section titled “Return item question response persisted — ✅ PASS”

Assertion: return_item_question_responses should contain a row for the test question with response_text = “Product packaging was damaged during shipping, device is non-functional”

SELECT riqr.id, riqr.return_item_id, riqr.question_version_id,
riqr.response_text, ri.lot_number, rpqv.question_text
FROM return_item_question_responses riqr
JOIN return_items ri ON ri.id = riqr.return_item_id
JOIN returns r ON r.id = ri.return_id
JOIN return_product_question_versions rpqv ON rpqv.id = riqr.question_version_id
WHERE r.created_by_user_id = $1
AND r.created_at > NOW() - INTERVAL '30 minutes'
AND riqr.question_version_id = $2
ORDER BY riqr.created_at DESC
idreturn_item_idquestion_version_idresponse_textlot_numberquestion_text
019db86d-564b-77bc-9a4d-f3d1123ab29f019db86d-5649-72e7-a93c-84c52d27f0ce02822222-2222-4222-8222-222222222222Product packaging was damaged during shipping, device is non-functionalURS028-RETURN-001Describe the issue with this product

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: Navigate to returnsuser_log:user:login

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:39:15.004Z

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

4 event(s) captured:

TimeTypeActionUserOrgObject IDPerformedReason
2026-04-23 03:39:19Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:39:28Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:40:23Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions
2026-04-23 03:41:11Zuser_loguser:loginbob.kauffman@stellartech.comStellarTech Medical Solutions