# Validation Report: URS-075

**Title:** Per-account product availability via enablement flag
**Date:** 2026-08-03T23:05:41.140Z
**Duration:** 100.4s
**Overall Status:** ✅ PASS

## User Requirement

> The system shall control per-account product availability via an enablement flag: products whose catalog entry requires per-account enablement default to disabled on new accounts, must be explicitly enabled before they appear in billing workflows, and can be disabled at any time to remove them from billing without deleting the pricing record.

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

## Environment

- **Inbox URL:** http://localhost:37051
- **Database:** localhost:40461/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: Disabled by default — ✅ PASS

**What this step proves:**

Documents that LL516RE (LiraLock® RE Series) is configured with requires_account_enablement=true on its catalog entry, and that its pricing row on the ROSS account starts with enabled=false. The product is absent from the bill-only product picker while disabled, proving that the enablement gate is active.

**Audit events generated by this step:**

*(Evidence scoped to step execution window: 2026-08-03T23:05:47.520Z → 2026-08-03T23:06:06.292Z)*

| Time | Type | Action | User | Org | Performed |
|------|------|--------|------|-----|-----------|
| 2026-08-03 23:05:52Z | user_log | user:login | blair.bennett@corvetasurgical.com | Corveta Surgical Group | — |

**Screenshots:**

![step 01 product settings](screenshots/step-01-product-settings.png)

![step 01 disabled on account](screenshots/step-01-disabled-on-account.png)

![step 01 product absent from picker](screenshots/step-01-product-absent-from-picker.png)

**Video recording:**

[▶ Watch step recording](videos/step-01-absent-from-picker.webm)

---

### 2. Step 2: Standard product baseline — ✅ PASS

**What this step proves:**

Shows that standard products (requires_account_enablement=false, e.g. IK2025LL) appear in the bill-only product picker without any explicit enable action. This proves that the enabled=true default is intact for products that do not require per-account enablement.

**Screenshots:**

![step 02 standard products in picker](screenshots/step-02-standard-products-in-picker.png)

**Video recording:**

[▶ Watch step recording](videos/step-02-standard-product-baseline.webm)

---

### 3. Step 3: Enable product — ✅ PASS

**What this step proves:**

An administrator enables LL516RE on the ROSS account using the pricing page toggle. The pricing row flips to enabled=true immediately. The database check in Phase 3 confirms the toggle persisted correctly.

**Screenshots:**

![step 03 before enable](screenshots/step-03-before-enable.png)

![step 03 after enable](screenshots/step-03-after-enable.png)

**Video recording:**

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

---

### 4. Step 4: Bill enabled product — ✅ PASS

**What this step proves:**

After being enabled, LL516RE appears in the bill-only product picker and a bill-only order is submitted successfully. The billing order item records the stored approved price, proving that the product is fully billable once enabled.

**Audit events generated by this step:**

*(Evidence scoped to step execution window: 2026-08-03T23:06:47.703Z → 2026-08-03T23:06:53.768Z)*

| Time | Type | Action | User | Org | Performed |
|------|------|--------|------|-----|-----------|
| 2026-08-03 23:06:51Z | decision | bill_only.link_purchase_order | blair.bennett@corvetasurgical.com | Corveta Surgical Group | no |
| 2026-08-03 23:06:51Z | decision | bill_only_order.inventory_items_decrement | blair.bennett@corvetasurgical.com | Vantis | yes |
| 2026-08-03 23:06:51Z | decision | bill_only_order.direct_po_import_on_create | blair.bennett@corvetasurgical.com | Vantis | no |
| 2026-08-03 23:06:51Z | billing_order | status_change | blair.bennett@corvetasurgical.com | Vantis | — |
| 2026-08-03 23:06:52Z | transactional_email | new_bill_only | — | Corveta Surgical Group | — |

**Screenshots:**

![step 04 product in picker](screenshots/step-04-product-in-picker.png)

![step 04 product selected](screenshots/step-04-product-selected.png)

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

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

**Video recording:**

[▶ Watch step recording](videos/step-04-bill-enabled-product.webm)

---

### 5. Step 5: Disable product — ✅ PASS

**What this step proves:**

An administrator disables LL516RE on the ROSS account using the same toggle. The pricing row flips to enabled=false immediately. LL516RE disappears from the bill-only product picker, proving that the gate can be re-activated after enablement.

**Audit events generated by this step:**

*(Evidence scoped to step execution window: 2026-08-03T23:06:59.808Z → 2026-08-03T23:07:19.985Z)*

| Time | Type | Action | User | Org | Performed |
|------|------|--------|------|-----|-----------|
| 2026-08-03 23:07:05Z | user_log | user:login | blair.bennett@corvetasurgical.com | Corveta Surgical Group | — |

**Screenshots:**

![step 05 before disable](screenshots/step-05-before-disable.png)

![step 05 after disable](screenshots/step-05-after-disable.png)

![step 05 product absent after disable](screenshots/step-05-product-absent-after-disable.png)

**Video recording:**

[▶ Watch step recording](videos/step-05-absent-after-disable.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.

### LL516RE catalog entry has requires_account_enablement=true — ✅ PASS

**Assertion:** LL516RE has requires_account_enablement=true and allow_billing=true

```sql
SELECT p.sku, p.active AS product_active,
            pci.requires_account_enablement, pci.allow_billing, pci.active AS catalog_active
     FROM org_products p
     JOIN product_catalog_items pci ON pci.product_id = p.id AND pci.active = true
     WHERE p.id = $1 AND p.active = true
```

| sku | product_active | requires_account_enablement | allow_billing | catalog_active |
| --- | --- | --- | --- | --- |
| LL516RE | true | true | true | true |

### LL516RE has an active pricing row on ROSS — ✅ PASS

**Assertion:** LL516RE pricing row exists on ROSS with status=effective

```sql
SELECT id, price, status, active, enabled
     FROM sales_account_approved_pricing
     WHERE org_product_id = $1 AND sales_account_id = $2 AND active = true
```

| id | price | status | active | enabled |
| --- | --- | --- | --- | --- |
| 019fc9e1-6792-7187-844f-2aee65e31cff | 750.00 | effective | true | false |

### Bill-only order was created for LL516RE while it was enabled — ✅ PASS

**Assertion:** At least one billing order item for LL516RE exists with a positive unit_price

```sql
SELECT bo.id, boi.unit_price, bo.status
     FROM billing_orders bo
     JOIN billing_order_items boi ON boi.billing_order_id = bo.id
     WHERE boi.product_id = $1 AND bo.notes LIKE $2
```

| id | unit_price | status |
| --- | --- | --- |
| 019fc9e1-4469-7fa1-a203-f8aa46a4cfc8 | 750.00 | submitted |

### LL516RE active pricing row on ROSS is enabled=false after re-disabling via the UI — ✅ PASS

**Assertion:** enabled=false (the UI disable toggle set it; billing is now blocked)

```sql
SELECT enabled FROM sales_account_approved_pricing
     WHERE org_product_id = $1 AND sales_account_id = $2 AND active = true
```

| enabled |
| --- |
| false |

## 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-08-03T23:05:39.172Z

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

14 event(s) captured:

| Time | Type | Action | User | Org | Object ID | Performed | Reason |
|------|------|--------|------|-----|-----------|-----------|--------|
| 2026-08-03 23:05:40Z | checklist | checklists.create | — | Corveta Surgical Group | 019fc9e0-2ed6-7f93-8a08-ee93f35193b9 | — |  |
| 2026-08-03 23:05:40Z | decision | ensure_lot_expiration_checklist | — | Corveta Surgical Group | b2c3d4e5-f6a7-8901-bcde-f12345678901 | yes | created_1_reopened_0_already_open_1 |
| 2026-08-03 23:05:44Z | user_log | user:login | alex.admin@vantismedical.com | Vantis | — | — |  |
| 2026-08-03 23:05:52Z | user_log | user:login | blair.bennett@corvetasurgical.com | Corveta Surgical Group | — | — |  |
| 2026-08-03 23:06:09Z | user_log | user:login | blair.bennett@corvetasurgical.com | Corveta Surgical Group | — | — |  |
| 2026-08-03 23:06:25Z | user_log | user:login | alex.admin@vantismedical.com | Vantis | — | — |  |
| 2026-08-03 23:06:34Z | user_log | user:login | blair.bennett@corvetasurgical.com | Corveta Surgical Group | — | — |  |
| 2026-08-03 23:06:51Z | decision | bill_only.link_purchase_order | blair.bennett@corvetasurgical.com | Corveta Surgical Group | 019fc9e1-4469-7fa1-a203-f8aa46a4cfc8 | no | no_purchase_order_selected |
| 2026-08-03 23:06:51Z | decision | bill_only_order.inventory_items_decrement | blair.bennett@corvetasurgical.com | Vantis | 019fc9e1-4469-7fa1-a203-f8aa46a4cfc8 | yes | inventory_items_decremented |
| 2026-08-03 23:06:51Z | decision | bill_only_order.direct_po_import_on_create | blair.bennett@corvetasurgical.com | Vantis | 019fc9e1-4469-7fa1-a203-f8aa46a4cfc8 | no | No uploaded PO documents |
| 2026-08-03 23:06:51Z | billing_order | status_change | blair.bennett@corvetasurgical.com | Vantis | 019fc9e1-4469-7fa1-a203-f8aa46a4cfc8 | — |  |
| 2026-08-03 23:06:52Z | transactional_email | new_bill_only | — | Corveta Surgical Group | 019fc9e1-4469-7fa1-a203-f8aa46a4cfc8 | — |  |
| 2026-08-03 23:06:56Z | user_log | user:login | alex.admin@vantismedical.com | Vantis | — | — |  |
| 2026-08-03 23:07:05Z | user_log | user:login | blair.bennett@corvetasurgical.com | Corveta Surgical Group | — | — |  |

## Additional Video Evidence

The following screencast recordings were captured but could not be matched to a specific test step. Step-matched recordings appear inline in their respective step sections above.

- [videos/step-01-disabled-by-default.webm](videos/step-01-disabled-by-default.webm)
- [videos/step-05-disable-product.webm](videos/step-05-disable-product.webm)
