# Validation Report: URS-062

**Title:** Order Type Options (Dropship, Consignment, Direct Sales)
**Date:** 2026-04-23T03:44:42.590Z
**Duration:** 161.2s
**Overall Status:** ✅ PASS

## User Requirement

> The system shall allow a user to select multiple order types.

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

## Environment

- **Inbox URL:** http://localhost:65359
- **Database:** localhost:65360/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 as sales rep — ✅ PASS

**What this step proves:**

Proves that Bob Kauffman (StellarTech Sales Rep) can authenticate and reach the order creation form. Establishes the user context for all subsequent steps.

**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 2a: All order types visible — ✅ PASS

**What this step proves:**

After selecting an account delivery location, all three order types — Consignment, Direct Order, and Drop-ship — are simultaneously visible and Consignment is the default selection. This satisfies the URS-062 requirement that order type options are context-dependent on the chosen delivery location.

**Screenshots:**

![step 02 all order types visible](screenshots/step-02-all-order-types-visible.png)

**Video recording:**

[▶ Watch step recording](videos/step-02-order-types-visible.webm)

---

### 3. Step 2b: Trunk hides order type selector — ✅ PASS

**What this step proves:**

Negative case for the context-dependent UI rule. Selecting the trunk delivery radio hides the order-type selector entirely — there are zero `input[name="orderType_display"]` radios rendered. Trunk deliveries are implicitly typed as "trunk" and do not expose the Consignment / Direct / Drop-ship options available to account deliveries.

**Screenshots:**

![step 02b trunk no order type selector](screenshots/step-02b-trunk-no-order-type-selector.png)

**Video recording:**

[▶ Watch step recording](videos/step-02b-trunk-hides-selector.webm)

---

### 4. Step 3: Select order types — ✅ PASS

**What this step proves:**

Each order type can be selected independently. Selecting Drop-ship reveals the "Receiving Rep" selector; selecting Consignment or Direct Order hides it. Confirms context-dependent UI responds correctly to user input.

**Screenshots:**

![step 03 direct order selected](screenshots/step-03-direct-order-selected.png)

![step 03 dropship selected with rep](screenshots/step-03-dropship-selected-with-rep.png)

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

**Video recording:**

[▶ Watch step recording](videos/step-03-select-order-types.webm)

---

### 5. Step 4: Change delivery location — ✅ PASS

**What this step proves:**

Changing the delivery location from one account to another keeps all three order type options visible without a page reload, confirming the UI updates reactively and the order type selector is not cleared when the location changes.

**Screenshots:**

![step 04 boss order types](screenshots/step-04-boss-order-types.png)

![step 04 copley order types](screenshots/step-04-copley-order-types.png)

**Video recording:**

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

---

### 6. Step 5: Consignment order — ✅ PASS

**What this step proves:**

A complete consignment order is created and submitted end-to-end. The success screen confirms the order request was accepted with order type "Consignment", proving the consignment flow is fully operational.

**Audit events generated by this step:**

*(Evidence scoped to step execution window: 2026-04-23T03:46:06.927Z → 2026-04-23T03:46:20.436Z)*

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

**Screenshots:**

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

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

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

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

**Video recording:**

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

---

### 7. Step 6: Direct order — ✅ PASS

**What this step proves:**

A complete direct sales order is created and submitted end-to-end. The success screen confirms the order request was accepted with order type "Direct", proving the direct sales flow is fully operational.

**Audit events generated by this step:**

*(Evidence scoped to step execution window: 2026-04-23T03:46:31.077Z → 2026-04-23T03:46:44.585Z)*

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

**Screenshots:**

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

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

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

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

**Video recording:**

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

---

### 8. Step 7: Dropship order — ✅ PASS

**What this step proves:**

A complete dropship order is created and submitted end-to-end. The success screen confirms the order request was accepted with order type "Drop-ship", proving the dropship flow — including the Receiving Rep selector — is fully operational.

**Audit events generated by this step:**

*(Evidence scoped to step execution window: 2026-04-23T03:46:57.133Z → 2026-04-23T03:47:12.970Z)*

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

**Screenshots:**

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

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

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

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

**Video recording:**

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

---

### 9. Step 8: Orders summary — ✅ PASS

**What this step proves:**

The orders list is inspected after all three submissions. The recently created consignment, direct, and dropship orders are all visible, confirming the system persisted each order type correctly and all three types appear in the same list view.

**Screenshots:**

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

**Video recording:**

[▶ Watch step recording](videos/step-08-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.

### Recent orders created by test user — ✅ PASS

**Assertion:** At least one order should have been created during the test

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

| id | request_number | order_type | status | location_id | sales_account_id | created_at |
| --- | --- | --- | --- | --- | --- | --- |
| 019db872-e06d-792a-aba6-7ac02c05de49 | OR-3 | dropship | submitted | a3e7f8a9-b0c1-2345-0123-456789012345 | 2ac9d0e1-f2a3-4567-2345-678901234567 | 2026-04-23T03:47:09.538Z |
| 019db872-71a1-72ed-aaac-698d95ff17ae | OR-2 | direct | submitted | 81c5d6e7-f8a9-0123-8901-234567890123 | 1fb8c9d0-e1f2-3456-1234-567890123456 | 2026-04-23T03:46:41.173Z |
| 019db872-133e-7d5c-8615-932d8b7daa48 | OR-1 | consignment | submitted | 6ea3b4c5-d6e7-8901-6789-012345678901 | fea7b8c9-d0e1-2345-0123-456789012345 | 2026-04-23T03:46:17.003Z |

### Consignment order created — ✅ PASS

**Assertion:** A consignment order should exist from the test run

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

| id | request_number | order_type | status | sales_account_id |
| --- | --- | --- | --- | --- |
| 019db872-133e-7d5c-8615-932d8b7daa48 | OR-1 | consignment | submitted | fea7b8c9-d0e1-2345-0123-456789012345 |

### Direct order created — ✅ PASS

**Assertion:** A direct order should exist from the test run

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

| id | request_number | order_type | status | sales_account_id |
| --- | --- | --- | --- | --- |
| 019db872-71a1-72ed-aaac-698d95ff17ae | OR-2 | direct | submitted | 1fb8c9d0-e1f2-3456-1234-567890123456 |

### Dropship order created with receiving rep — ✅ PASS

**Assertion:** A dropship order should exist from the test run and have receiving_rep_user_id populated

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

| id | request_number | order_type | status | sales_account_id | receiving_rep_user_id |
| --- | --- | --- | --- | --- | --- |
| 019db872-e06d-792a-aba6-7ac02c05de49 | OR-3 | dropship | submitted | 2ac9d0e1-f2a3-4567-2345-678901234567 | 17b8c9d0-e1f2-3456-1234-567890123456 |

### All three order types present — ✅ PASS

**Assertion:** Orders of all three types (consignment, direct, dropship) should exist

```sql
SELECT order_type, COUNT(*) as order_count
      FROM order_requests
      WHERE requested_by_user_id = $1
        AND notes LIKE '%URS-062%'
      GROUP BY order_type
      ORDER BY order_type
```

| order_type | order_count |
| --- | --- |
| consignment | 1 |
| direct | 1 |
| dropship | 1 |

### All orders have delivery locations — ✅ PASS

**Assertion:** Every order should have a delivery location assigned

```sql
SELECT orq.id, orq.order_type, orq.location_id, orq.sales_account_id,
        rwl.name as location_name, rwl.type as location_type
      FROM order_requests orq
      LEFT JOIN real_world_locations rwl ON rwl.id = orq.location_id
      WHERE orq.requested_by_user_id = $1
        AND orq.created_at > NOW() - INTERVAL '30 minutes'
      ORDER BY orq.created_at DESC
```

| id | order_type | location_id | sales_account_id | location_name | location_type |
| --- | --- | --- | --- | --- | --- |
| 019db872-e06d-792a-aba6-7ac02c05de49 | dropship | a3e7f8a9-b0c1-2345-0123-456789012345 | 2ac9d0e1-f2a3-4567-2345-678901234567 | Connecticut Ortho - Shipping | asc |
| 019db872-71a1-72ed-aaac-698d95ff17ae | direct | 81c5d6e7-f8a9-0123-8901-234567890123 | 1fb8c9d0-e1f2-3456-1234-567890123456 | Copley Hospital - Shipping | hospital |
| 019db872-133e-7d5c-8615-932d8b7daa48 | consignment | 6ea3b4c5-d6e7-8901-6789-012345678901 | fea7b8c9-d0e1-2345-0123-456789012345 | BOSS - Shipping | hospital |

## 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:44:40.666Z

<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>

12 event(s) captured:

| Time | Type | Action | User | Org | Object ID | Performed | Reason |
|------|------|--------|------|-----|-----------|-----------|--------|
| 2026-04-23 03:44:45Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:44:53Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:45:08Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:45:18Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:45:38Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:45:58Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:46:17Z | decision | order_request_created | bob.kauffman@stellartech.com | ZuriMED | 019db872-133e-7d5c-8615-932d8b7daa48 | yes | Order request OR-1 created (importSource=manual) |
| 2026-04-23 03:46:21Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:46:41Z | decision | order_request_created | bob.kauffman@stellartech.com | ZuriMED | 019db872-71a1-72ed-aaac-698d95ff17ae | yes | Order request OR-2 created (importSource=manual) |
| 2026-04-23 03:46:45Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
| 2026-04-23 03:47:09Z | decision | order_request_created | bob.kauffman@stellartech.com | ZuriMED | 019db872-e06d-792a-aba6-7ac02c05de49 | yes | Order request OR-3 created (importSource=manual) |
| 2026-04-23 03:47:14Z | user_log | user:login | bob.kauffman@stellartech.com | StellarTech Medical Solutions | — | — |  |
