Skip to content

URS-055 · Restrict uncertified reps from actions until approved

Status: PASS  ·  Duration: 1m 33s  ·  Run Date: April 21, 2026


PASS

Step 1: Bill-only blocked

Step 1: Bill-only blocked


PASS

Step 2: Order request blocked


PASS

Step 3: Certified rep control


PASS

Step 4: Manufacturer approval

Step 4: Manufacturer approval

Step 4: Manufacturer approval


PASS

Step 5: Bill-only after certification

Step 5: Bill-only after certification

Step 5: Bill-only after certification

Step 5: Bill-only after certification


PASS

Step 6: Order request after certification

PASS

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
idstatusactiveresponded_atresponded_by_user_id
95d6e7f8-a9b0-1234-9012-345678901234activetrue2026-04-21T02:25:43.022Zd4e5f6a7-b8c9-0123-def1-234567890123

PASS

Bob’s relationship should remain active and unaffected by Ryan’s approval

SELECT id, status, active
FROM organization_representation_relationships
WHERE id = $1
idstatusactive
84c5d6e7-f8a9-0123-8901-234567890123proposed_pending_onboardingtrue

PASS

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
idto_statusfrom_statuschanged_by_user_idcreated_at
019daddb-986f-7399-8b2a-c755a6d76cf6activeproposedd4e5f6a7-b8c9-0123-def1-2345678901232026-04-21T02:25:42.988Z

Bill-only order created by Ryan after certification

Section titled “Bill-only order created by Ryan after certification”
PASS

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
idorder_numberstatuscreated_atcreated_by_user_id
019daddc-1c09-74a8-8951-d56bf41d1ffdBO-1submitted2026-04-21T02:26:16.679Z28c9d0e1-f2a3-4567-2345-678901234567

PASS

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
idevent_typeactioncreated_atuser_idobject_idpayload_preview
019daddb-9871-7c48-a5df-d191ace3cec0user_logrep_onboarding_request_approved2026-04-21T02:25:43.042Zd4e5f6a7-b8c9-0123-def1-23456789012395d6e7f8-a9b0-1234-9012-345678901234{“userId”: “28c9d0e1-f2a3-4567-2345-678901234567”, “userN…