URS-055 · Restrict uncertified reps from actions until approved
Status: PASS · Duration: 1m 33s · Run Date: April 21, 2026
Test Scenarios
Section titled “Test Scenarios”Step 1: Bill-only blocked
Section titled “Step 1: Bill-only blocked”

Step 2: Order request blocked
Section titled “Step 2: Order request blocked”
Step 3: Certified rep control
Section titled “Step 3: Certified rep control”
Step 4: Manufacturer approval
Section titled “Step 4: Manufacturer approval”


Step 5: Bill-only after certification
Section titled “Step 5: Bill-only after certification”



Step 6: Order request after certification
Section titled “Step 6: Order request after certification”
Recordings
Section titled “Recordings”step 01 billing blocked
Section titled “step 01 billing blocked”step 02 order request blocked
Section titled “step 02 order request blocked”step 03 certified control
Section titled “step 03 certified control”step 04 manufacturer approval
Section titled “step 04 manufacturer approval”step 05 billing submitted
Section titled “step 05 billing submitted”step 06 order request accessible
Section titled “step 06 order request accessible”Database Validations
Section titled “Database Validations”Ryan relationship now active
Section titled “Ryan relationship now active”Ryan’s representation relationship should be active after manufacturer approval
SELECT id, status, active, responded_at, responded_by_user_id FROM organization_representation_relationships WHERE id = $1| id | status | active | responded_at | responded_by_user_id |
|---|---|---|---|---|
| 95d6e7f8-a9b0-1234-9012-345678901234 | active | true | 2026-04-21T02:25:43.022Z | d4e5f6a7-b8c9-0123-def1-234567890123 |
Bob relationship still active (control)
Section titled “Bob relationship still active (control)”Bob’s relationship should remain active and unaffected by Ryan’s approval
SELECT id, status, active FROM organization_representation_relationships WHERE id = $1| id | status | active |
|---|---|---|
| 84c5d6e7-f8a9-0123-8901-234567890123 | proposed_pending_onboarding | true |
Status change history recorded
Section titled “Status change history recorded”Status change to “active” should be recorded in history table
SELECT id, to_status, from_status, changed_by_user_id, created_at FROM organization_representation_request_status_changes WHERE relationship_id = $1 AND created_at > NOW() - INTERVAL '30 minutes' ORDER BY created_at DESC LIMIT 5| id | to_status | from_status | changed_by_user_id | created_at |
|---|---|---|---|---|
| 019daddb-986f-7399-8b2a-c755a6d76cf6 | active | proposed | d4e5f6a7-b8c9-0123-def1-234567890123 | 2026-04-21T02:25:42.988Z |
Bill-only order created by Ryan after certification
Section titled “Bill-only order created by Ryan after certification”At least one bill-only order should have been created by Ryan after being certified
SELECT bo.id, bo.order_number, bo.status, bo.created_at, bo.created_by_user_id FROM billing_orders bo WHERE bo.created_by_user_id = $1 AND bo.created_at > NOW() - INTERVAL '30 minutes' ORDER BY bo.created_at DESC LIMIT 5| id | order_number | status | created_at | created_by_user_id |
|---|---|---|---|---|
| 019daddc-1c09-74a8-8951-d56bf41d1ffd | BO-1 | submitted | 2026-04-21T02:26:16.679Z | 28c9d0e1-f2a3-4567-2345-678901234567 |
Audit trail for representative approval
Section titled “Audit trail for representative approval”Audit/decision events should exist referencing Ryan after the approval action
SELECT ae.id, ae.event_type, ae.action, ae.created_at, ae.user_id, ae.object_id, substring(ae.payload::text, 1, 500) as payload_preview FROM audit_events ae WHERE ae.created_at > NOW() - INTERVAL '30 minutes' AND (ae.object_id = $1 OR ae.object_id = $2) ORDER BY ae.created_at DESC LIMIT 10| id | event_type | action | created_at | user_id | object_id | payload_preview |
|---|---|---|---|---|---|---|
| 019daddb-9871-7c48-a5df-d191ace3cec0 | user_log | rep_onboarding_request_approved | 2026-04-21T02:25:43.042Z | d4e5f6a7-b8c9-0123-def1-234567890123 | 95d6e7f8-a9b0-1234-9012-345678901234 | {“userId”: “28c9d0e1-f2a3-4567-2345-678901234567”, “userN… |