# Validation Report: URS-010

**Title:** Submit different order types (Bill-Only, Trunk Stock, Direct, Drop-ship)
**Date:** 2026-04-23T03:35:46.490Z
**Duration:** 111.3s
**Overall Status:** ✅ PASS

## User Requirement

> The system shall allow reps to submit different order types (Bill‑Only, Trunk Stock, Direct, Drop‑ship).

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

## Environment

- **Inbox URL:** http://localhost:62490
- **Database:** localhost:62491/cc_repinbox_dev

## Setup

Status: ✅ PASS

## Test Steps

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: Login and navigate — ✅ PASS

**What this step proves:**

Proves that Bob Kauffman (StellarTech sales rep) can authenticate and reach the order creation form. Establishes the user context used for every subsequent submission.

**Screenshots:**

![step 01 logged in](screenshots/step-01-logged-in.png)

![step 01 order creation form](screenshots/step-01-order-creation-form.png)

**Video recording:**

[▶ Watch step recording](videos/step-01-login.webm)

---

### 2. Step 2: Bill-Only order — ✅ PASS

**What this step proves:**

A Bill-Only order is created and submitted end-to-end via the /billing/new flow. The rep selects BOSS Surgical as the sales account, uses their own trunk (TRUNK-36) as the inventory source, and adds SpeedPatch with the seeded lot. The success screen confirms the bill-only submission landed as a billing_orders row. A "New Bill-Only Order" notification email is dispatched to the rep confirming the submission.

**Audit events generated by this step:**

*(Evidence scoped to step execution window: 2026-04-23T03:36:09.140Z → 2026-04-23T03:36:23.761Z)*

| Time | Type | Action | User | Org | Performed |
|------|------|--------|------|-----|-----------|
| 2026-04-23 03:36:18Z | decision | bill_only_order.enqueue_upload_classification | bob.kauffman@stellartech.com | ZuriMED | no |
| 2026-04-23 03:36:19Z | transactional_email | new_bill_only | — | StellarTech 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](screenshots/emails/2026-04-23T03-36-19-245Z-New_Bill-Only_Order_-_4_22_2026_-_ZuriMED_BO-1.png)

**Screenshots:**

![step 02 bill only devices](screenshots/step-02-bill-only-devices.png)

![step 02 bill only product](screenshots/step-02-bill-only-product.png)

![step 02 bill only documents](screenshots/step-02-bill-only-documents.png)

![step 02 bill only review](screenshots/step-02-bill-only-review.png)

![step 02 bill only submitted](screenshots/step-02-bill-only-submitted.png)

**Video recording:**

[▶ Watch step recording](videos/step-02-bill-only.webm)

---

### 3. Step 3: Consignment order — ✅ PASS

**What this step proves:**

A consignment order is created and submitted end-to-end via /orders/requests/new. The rep selects BOSS Surgical as the delivery location; Consignment is the default order type. The success screen confirms the order_requests row was accepted with order type "Consignment".

**Audit events generated by this step:**

*(Evidence scoped to step execution window: 2026-04-23T03:36:32.963Z → 2026-04-23T03:36:38.778Z)*

| Time | Type | Action | User | Org | Performed |
|------|------|--------|------|-----|-----------|
| 2026-04-23 03:36:38Z | decision | order_request_created | bob.kauffman@stellartech.com | ZuriMED | yes |

**Screenshots:**

![step 03 consignment step2](screenshots/step-03-consignment-step2.png)

![step 03 consignment products](screenshots/step-03-consignment-products.png)

![step 03 consignment review](screenshots/step-03-consignment-review.png)

![step 03 consignment submitted](screenshots/step-03-consignment-submitted.png)

**Video recording:**

[▶ Watch step recording](videos/step-03-consignment.webm)

---

### 4. Step 4: Direct order — ✅ PASS

**What this step proves:**

A direct sales order is created and submitted end-to-end via /orders/requests/new. The rep selects Copley Hospital as the delivery location and switches the order type to Direct Order. The success screen confirms the order_requests row was accepted with order type "Direct".

**Audit events generated by this step:**

*(Evidence scoped to step execution window: 2026-04-23T03:36:51.716Z → 2026-04-23T03:36:57.315Z)*

| Time | Type | Action | User | Org | Performed |
|------|------|--------|------|-----|-----------|
| 2026-04-23 03:36:57Z | decision | order_request_created | bob.kauffman@stellartech.com | ZuriMED | yes |

**Screenshots:**

![step 04 direct step2](screenshots/step-04-direct-step2.png)

![step 04 direct products](screenshots/step-04-direct-products.png)

![step 04 direct review](screenshots/step-04-direct-review.png)

![step 04 direct submitted](screenshots/step-04-direct-submitted.png)

**Video recording:**

[▶ Watch step recording](videos/step-04-direct.webm)

---

### 5. Step 5: Drop-ship order — ✅ PASS

**What this step proves:**

A drop-ship order is created and submitted end-to-end via /orders/requests/new. The rep selects Connecticut Orthopaedic Surgery Center as the delivery location and switches the order type to Drop-ship, which reveals the Receiving Rep selector. The success screen confirms the order_requests row was accepted with order type "Drop-ship".

**Audit events generated by this step:**

*(Evidence scoped to step execution window: 2026-04-23T03:37:10.350Z → 2026-04-23T03:37:16.177Z)*

| Time | Type | Action | User | Org | Performed |
|------|------|--------|------|-----|-----------|
| 2026-04-23 03:37:15Z | decision | order_request_created | bob.kauffman@stellartech.com | ZuriMED | yes |

**Screenshots:**

![step 05 dropship step2](screenshots/step-05-dropship-step2.png)

![step 05 dropship products](screenshots/step-05-dropship-products.png)

![step 05 dropship review](screenshots/step-05-dropship-review.png)

![step 05 dropship submitted](screenshots/step-05-dropship-submitted.png)

**Video recording:**

[▶ Watch step recording](videos/step-05-dropship.webm)

---

### 6. Step 6: Orders summary — ✅ PASS

**What this step proves:**

Both the /orders/requests and /billing lists are opened after all submissions. Evidence screenshots show that the consignment, direct, drop-ship, and bill-only orders all persisted and are visible in their respective list views.

**Screenshots:**

![step 06 orders list](screenshots/step-06-orders-list.png)

![step 06 billing list](screenshots/step-06-billing-list.png)

**Video recording:**

[▶ Watch step recording](videos/step-06-summary.webm)

---

## Database Validations

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 order created — ✅ PASS

**Assertion:** A billing_orders row tagged URS-010 should exist for Bob

```sql
SELECT bo.id, bo.order_number, bo.status, bo.sales_account_id,
        bo.notes, bo.created_at
      FROM billing_orders bo
      WHERE bo.created_by_user_id = $1
        AND bo.notes LIKE '%URS-010%'
      ORDER BY bo.created_at DESC
      LIMIT 5
```

| id | order_number | status | sales_account_id | notes | created_at |
| --- | --- | --- | --- | --- | --- |
| 019db868-efbe-76a0-9b92-c2bd134663fc | BO-1 | submitted | fea7b8c9-d0e1-2345-0123-456789012345 | URS-010 validation: bill-only | 2026-04-23T03:36:18.045Z |

### Bill-Only item pulls from Bob's trunk with the seeded lot — ✅ PASS

**Assertion:** A billing_order_items row should reference TRUNK-36 and lot URS010-SP-001

```sql
SELECT boi.id, boi.billing_order_id, boi.location_id,
        boi.lot_number, op.title AS product_name,
        rwl.name AS location_name, rwl.type AS location_type
      FROM billing_order_items boi
      JOIN billing_orders bo ON boi.billing_order_id = bo.id
      LEFT JOIN org_products op ON boi.product_id = op.id
      LEFT JOIN real_world_locations rwl ON boi.location_id = rwl.id
      WHERE bo.created_by_user_id = $1
        AND bo.notes LIKE '%URS-010%'
        AND boi.lot_number = $2
      ORDER BY bo.created_at DESC
      LIMIT 10
```

| id | billing_order_id | location_id | lot_number | product_name | location_name | location_type |
| --- | --- | --- | --- | --- | --- | --- |
| 019db868-efba-7f7a-8bf8-0b0e0078973f | 019db868-efbe-76a0-9b92-c2bd134663fc | a6e7f8a9-b0c1-2345-0123-456789012345 | URS010-SP-001 | FiberLocker® Instrument SN | TRUNK-36 | trunk_stock |

### Consignment order submitted — ✅ PASS

**Assertion:** A consignment order_request tagged URS-010 should exist

```sql
SELECT id, request_number, order_type, status, sales_account_id, notes
      FROM order_requests
      WHERE requested_by_user_id = $1
        AND order_type = 'consignment'
        AND notes LIKE '%URS-010%'
      ORDER BY created_at DESC
      LIMIT 1
```

| id | request_number | order_type | status | sales_account_id | notes |
| --- | --- | --- | --- | --- | --- |
| 019db869-4030-74f8-a149-6a40de3c7b50 | OR-2 | consignment | submitted | fea7b8c9-d0e1-2345-0123-456789012345 | URS-010 validation: consignment |

### Direct order submitted — ✅ PASS

**Assertion:** A direct order_request tagged URS-010 should exist

```sql
SELECT id, request_number, order_type, status, sales_account_id, notes
      FROM order_requests
      WHERE requested_by_user_id = $1
        AND order_type = 'direct'
        AND notes LIKE '%URS-010%'
      ORDER BY created_at DESC
      LIMIT 1
```

| id | request_number | order_type | status | sales_account_id | notes |
| --- | --- | --- | --- | --- | --- |
| 019db869-887d-791a-a978-818c8d3abaf5 | OR-3 | direct | submitted | 1fb8c9d0-e1f2-3456-1234-567890123456 | URS-010 validation: direct |

### Drop-ship order submitted — ✅ PASS

**Assertion:** A dropship order_request tagged URS-010 should exist

```sql
SELECT id, request_number, order_type, status, sales_account_id, notes
      FROM order_requests
      WHERE requested_by_user_id = $1
        AND order_type = 'dropship'
        AND notes LIKE '%URS-010%'
      ORDER BY created_at DESC
      LIMIT 1
```

| id | request_number | order_type | status | sales_account_id | notes |
| --- | --- | --- | --- | --- | --- |
| 019db869-d1a7-7775-a653-ae4b6c39800b | OR-4 | dropship | submitted | 2ac9d0e1-f2a3-4567-2345-678901234567 | URS-010 validation: dropship |

### All four order types submitted — ✅ PASS

**Assertion:** All four order types should be present: consignment, direct, dropship (order_requests) plus at least one billing_orders row (Bill-Only)

```sql
SELECT
        (SELECT COUNT(DISTINCT order_type)::int
           FROM order_requests
           WHERE requested_by_user_id = $1
             AND notes LIKE '%URS-010%'
             AND order_type IN ('consignment', 'direct', 'dropship')) AS request_type_count,
        (SELECT COUNT(*)::int
           FROM billing_orders
           WHERE created_by_user_id = $1
             AND notes LIKE '%URS-010%') AS billing_order_count
```

| request_type_count | billing_order_count |
| --- | --- |
| 3 | 1 |

## Audit & Email Assertion Ledger

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.

### Audit Action Assertions

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.

| Step | Expected Audit Action | Found |
|------|-----------------------|-------|
| Step 2: Bill-Only order | `decision:bill_only_order.enqueue_upload_classification` | ✅ |

### Email Template Assertions

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.

| Step | Expected Template | Found |
|------|-------------------|-------|
| Step 2: Bill-Only order | `bill-only` | ✅ |

## Audit Log Events

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:35:44.607Z

<details><summary>Query used to capture events</summary>

```sql
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
```
</details>

11 event(s) captured:

| Time | Type | Action | User | Org | Object ID | Performed | Reason |
|------|------|--------|------|-----|-----------|-----------|--------|
| 2026-04-23 03:35:49Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:35:57Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:36:18Z | decision | bill_only_order.enqueue_upload_classification | bob.kauffman@stellartech.com | ZuriMED | 019db868-efbe-76a0-9b92-c2bd134663fc | no | No uploaded PO documents |
| 2026-04-23 03:36:19Z | transactional_email | new_bill_only | — | StellarTech Medical Solutions | 019db868-efbe-76a0-9b92-c2bd134663fc | — |  |
| 2026-04-23 03:36:25Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:36:38Z | decision | order_request_created | bob.kauffman@stellartech.com | ZuriMED | 019db869-4030-74f8-a149-6a40de3c7b50 | yes | Order request OR-2 created (importSource=manual) |
| 2026-04-23 03:36:43Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:36:57Z | decision | order_request_created | bob.kauffman@stellartech.com | ZuriMED | 019db869-887d-791a-a978-818c8d3abaf5 | yes | Order request OR-3 created (importSource=manual) |
| 2026-04-23 03:37:01Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:37:15Z | decision | order_request_created | bob.kauffman@stellartech.com | ZuriMED | 019db869-d1a7-7775-a653-ae4b6c39800b | yes | Order request OR-4 created (importSource=manual) |
| 2026-04-23 03:37:20Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |

## Email Evidence

1 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

**Template:** `New_Bill-Only_Order_-_4_22_2026_-_ZuriMED_BO-1`

![New Bill-Only Order - 4/22/2026 - ZuriMED BO-1](screenshots/emails/2026-04-23T03-36-19-245Z-New_Bill-Only_Order_-_4_22_2026_-_ZuriMED_BO-1.png)
