Skip to content

URS-016 · Auto-decrement Inventory After Order Submission

Title: Auto-decrement Inventory After Order Submission Date: 2026-09-29T02:24:46.612Z Duration: 193.9s Overall Status: ✅ PASS

The system shall automatically decrement inventory after a bill-only order is submitted.

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

Status: ✅ PASS

Each step below corresponds to one Playwright test that ran sequentially. Screenshots and video recordings provide visual evidence of the UI behaviour.

What this step proves:

Logs in as a sales rep (Blair Bennett) and navigates to TRUNK-36 to record the starting quantities for NovaPatch and LiraLock. This establishes the known baseline so subsequent steps can prove the correct delta was applied after each order.

Audit events generated by this step:

(Evidence matched by declared name — step timing not available or no events fell in window)

TimeTypeActionUserOrgPerformed
2026-09-29 02:25:17Zuser_loguser:loginblair.bennett@corvetasurgical.comCorveta Surgical Group—
2026-09-29 02:25:29Zuser_loguser:loginblair.bennett@corvetasurgical.comCorveta Surgical Group—
2026-09-29 02:26:44Zuser_loguser:loginblair.bennett@corvetasurgical.comCorveta Surgical Group—
2026-09-29 02:26:49Zuser_loguser:loginblair.bennett@corvetasurgical.comCorveta Surgical Group—
2026-09-29 02:27:25Zuser_loguser:loginblair.bennett@corvetasurgical.comCorveta Surgical Group—

Screenshots:

step 01 logged in

step 01 initial inventory

Video recording:


What this step proves:

Creates and submits a bill-only order for 3 NovaPatch and 2 LiraLock devices from trunk inventory. This exercises the full order-submission flow that should trigger an automatic inventory decrement in the database.

Audit events generated by this step:

(Evidence scoped to step execution window: 2026-09-29T02:25:39.810Z → 2026-09-29T02:26:40.688Z)

TimeTypeActionUserOrgPerformed
2026-09-29 02:25:41Zdecisionbill_only_order.duplicate_submission_blockblair.bennett@corvetasurgical.comCorveta Surgical Groupno
2026-09-29 02:26:37Zdecisionbill_only_order.duplicate_submission_blockblair.bennett@corvetasurgical.comCorveta Surgical Groupno
2026-09-29 02:26:37Zdecisionbill_only.link_purchase_orderblair.bennett@corvetasurgical.comCorveta Surgical Groupno
2026-09-29 02:26:37Zbilling_orderstatus_changeblair.bennett@corvetasurgical.comVantis—
2026-09-29 02:26:37Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis—
2026-09-29 02:26:37Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis—
2026-09-29 02:26:37Zdecisionrepresentatives.gate_rep_actionblair.bennett@corvetasurgical.comVantisno
2026-09-29 02:26:37Zdecisionrepresentatives.gate_rep_actionblair.bennett@corvetasurgical.comVantisno
2026-09-29 02:26:37Zdecisionbill_only_order.inventory_items_decrementblair.bennett@corvetasurgical.comVantisyes
2026-09-29 02:26:37Zdecisionbill_only_order.direct_po_import_on_createblair.bennett@corvetasurgical.comVantisno
2026-09-29 02:26:37ZdecisionbasicErp.deriveSalesOrderblair.bennett@corvetasurgical.comVantisno
2026-09-29 02:26:37Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis—
2026-09-29 02:26:39Zdecisionbill_only.notifications.cc_incident_recipients—Vantisno
2026-09-29 02:26:40Ztransactional_emailnew_bill_only—Corveta Surgical Group—

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 - 9/29/2026 - Vantis BO-1

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-1

New Bill-Only Order - 9/29/2026 - Vantis BO-1

Email 2: New Bill-Only Order - 9/29/2026 - Vantis BO-2

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-2

New Bill-Only Order - 9/29/2026 - Vantis BO-2

Email 3: New Bill-Only Order - 9/29/2026 - Vantis BO-3

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-3

New Bill-Only Order - 9/29/2026 - Vantis BO-3

Screenshots:

step 02 account selected

step 02 devices selected

step 02 documents

step 02 review

step 02 order submitted

Video recording:


3. Step 3: Verify first decrement — ✅ PASS

Section titled “3. Step 3: Verify first decrement — ✅ PASS”

What this step proves:

Navigates to TRUNK-36 immediately after the first order and confirms that NovaPatch and LiraLock quantities have each decreased by the ordered amount. This proves the inventory auto-decrement fires on order submission.

Screenshots:

step 03 inventory after first order

Video recording:


What this step proves:

Submits a second bill-only order and then re-checks the inventory to verify that quantities reflect both orders cumulatively. This proves the decrement is applied consistently across multiple successive submissions.

Audit events generated by this step:

(Evidence matched by declared name — step timing not available or no events fell in window)

TimeTypeActionUserOrgPerformed
2026-09-29 02:26:37Zdecisionbill_only_order.inventory_items_decrementblair.bennett@corvetasurgical.comVantisyes
2026-09-29 02:27:18Zdecisionbill_only_order.inventory_items_decrementblair.bennett@corvetasurgical.comVantisyes
2026-09-29 02:27:51Zdecisionbill_only_order.inventory_items_decrementblair.bennett@corvetasurgical.comVantisyes

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 - 9/29/2026 - Vantis BO-1

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-1

New Bill-Only Order - 9/29/2026 - Vantis BO-1

Email 2: New Bill-Only Order - 9/29/2026 - Vantis BO-2

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-2

New Bill-Only Order - 9/29/2026 - Vantis BO-2

Email 3: New Bill-Only Order - 9/29/2026 - Vantis BO-3

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-3

New Bill-Only Order - 9/29/2026 - Vantis BO-3

Screenshots:

step 04 second order submitted

step 04 inventory after second order

Video recording:


5. Step 5: Shortage edge case — ✅ PASS

Section titled “5. Step 5: Shortage edge case — ✅ PASS”

What this step proves:

Orders more NovaPatch units than are available in trunk stock. The system permits submission in best-effort mode and consumes all remaining units, bringing the count to zero. This proves the system handles inventory shortages without blocking the order while still tracking the discrepancy.

Audit events generated by this step:

(Evidence scoped to step execution window: 2026-09-29T02:27:47.145Z → 2026-09-29T02:27:57.031Z)

TimeTypeActionUserOrgPerformed
2026-09-29 02:27:51Zdecisionbill_only_order.inventory_items_decrementblair.bennett@corvetasurgical.comVantisyes
2026-09-29 02:27:51Zdecisionbill_only_order.direct_po_import_on_createblair.bennett@corvetasurgical.comVantisno
2026-09-29 02:27:51Zbilling_orderstatus_changeblair.bennett@corvetasurgical.comVantis—
2026-09-29 02:27:51ZdecisionbasicErp.deriveSalesOrderblair.bennett@corvetasurgical.comVantisno
2026-09-29 02:27:51Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis—
2026-09-29 02:27:51Zdecisionbill_only.link_purchase_orderblair.bennett@corvetasurgical.comCorveta Surgical Groupno
2026-09-29 02:27:51Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis—
2026-09-29 02:27:51Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis—
2026-09-29 02:27:51Zdecisionrepresentatives.gate_rep_actionblair.bennett@corvetasurgical.comVantisno
2026-09-29 02:27:51Zdecisionrepresentatives.gate_rep_actionblair.bennett@corvetasurgical.comVantisno
2026-09-29 02:27:51Zdecisionbill_only_order.duplicate_submission_blockblair.bennett@corvetasurgical.comCorveta Surgical Groupno
2026-09-29 02:27:52Zdecisionbill_only.notifications.cc_incident_recipients—Vantisno
2026-09-29 02:27:52Ztransactional_emailnew_bill_only—Corveta Surgical Group—

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 - 9/29/2026 - Vantis BO-1

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-1

New Bill-Only Order - 9/29/2026 - Vantis BO-1

Email 2: New Bill-Only Order - 9/29/2026 - Vantis BO-2

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-2

New Bill-Only Order - 9/29/2026 - Vantis BO-2

Email 3: New Bill-Only Order - 9/29/2026 - Vantis BO-3

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-3

New Bill-Only Order - 9/29/2026 - Vantis BO-3

Screenshots:

step 05 shortage warning

step 05 review with shortage

step 05 shortage result

step 05 final inventory

Video recording:


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.

Inventory items exist at trunk — ✅ PASS

Section titled “Inventory items exist at trunk — ✅ PASS”

Assertion: Both test inventory items (NovaPatch and LiraLock) should exist at TRUNK-36

SELECT ii.id, ii.di, ii.lot, ii.quantity_ready, ii.quantity_backordered, ii.quantity_in_transit
FROM inventory_items ii
WHERE ii.real_world_location_id = $1
AND ii.lot IN ($2, $3)
ORDER BY ii.lot
iddilotquantity_readyquantity_backorderedquantity_in_transit
349f34d2-a717-4429-9fa1-fd4762591b7a07649988202247URS016-FL-0011200
4f8551d2-ec58-4abf-b6df-b50b8d725a0607649988202230URS016-SP-001000

Inventory quantities decremented — ✅ PASS

Section titled “Inventory quantities decremented — ✅ PASS”

Assertion: Both inventory items should have quantity_ready less than their initial values

SELECT ii.lot, ii.quantity_ready,
CASE
WHEN ii.lot = $2 THEN 20
WHEN ii.lot = $3 THEN 15
END as initial_quantity,
CASE
WHEN ii.lot = $2 THEN 20 - ii.quantity_ready
WHEN ii.lot = $3 THEN 15 - ii.quantity_ready
END as total_decremented
FROM inventory_items ii
WHERE ii.real_world_location_id = $1
AND ii.lot IN ($2, $3)
ORDER BY ii.lot
lotquantity_readyinitial_quantitytotal_decremented
URS016-FL-00112153
URS016-SP-00102020

Recent billing orders created — ✅ PASS

Section titled “Recent billing orders created — ✅ PASS”

Assertion: At least one billing order should have been created by Blair Bennett in the last 30 minutes

SELECT bo.id, bo.order_number, bo.status, bo.procedure_date,
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_numberstatusprocedure_datecreated_atcreated_by_user_id
01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3BO-3submitted2026-09-29T00:00:00.000Z2026-09-29T02:27:51.885Z17b8c9d0-e1f2-3456-1234-567890123456
01a0eafc-e7a6-7dfc-9006-bd7f89526d60BO-2submitted2026-09-29T00:00:00.000Z2026-09-29T02:27:18.004Z17b8c9d0-e1f2-3456-1234-567890123456
01a0eafc-4aa0-7a25-96a2-7afa2738f1dbBO-1submitted2026-09-29T00:00:00.000Z2026-09-29T02:26:37.635Z17b8c9d0-e1f2-3456-1234-567890123456

Billing order items reference correct products — ✅ PASS

Section titled “Billing order items reference correct products — ✅ PASS”

Assertion: Billing order items should reference NovaPatch and/or LiraLock products

SELECT boi.id, boi.billing_order_id, op.title as product_name,
boi.lot_number, boi.serial_number, boi.location_id,
boi.inventory_discrepancy
FROM billing_order_items boi
JOIN org_products op ON boi.product_id = op.id
JOIN billing_orders bo ON boi.billing_order_id = bo.id
WHERE bo.created_by_user_id = $1
AND bo.created_at > NOW() - INTERVAL '30 minutes'
ORDER BY bo.created_at DESC, op.title
idbilling_order_idproduct_namelot_numberserial_numberlocation_idinventory_discrepancy
01a0eafd-6bf0-7c93-92b8-6003ff7cea0601a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345true
01a0eafd-6bf0-7c93-92b8-600bc12ec78101a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-600c929a63e901a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-600dd7ddb0b501a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-600ec9a598dd01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-600f779ac30001a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-6010bf50e1ff01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-601125a798da01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-6012c405f00701a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-5fff1d8217b601a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345true
01a0eafd-6bf0-7c93-92b8-6000a91854d301a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345true
01a0eafd-6bf0-7c93-92b8-600125bfe73d01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345true
01a0eafd-6bf0-7c93-92b8-60021791300801a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345true
01a0eafd-6bf0-7c93-92b8-60040f8e3ef201a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-6005d2368e4d01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-6006f52e284c01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-6007296f35d601a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-60080c7cdad601a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-600958151dfa01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafd-6bf0-7c93-92b8-600a4f15770c01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafc-e79b-7e67-ae30-bab8884dbea501a0eafc-e7a6-7dfc-9006-bd7f89526d60LiraLock® Instrument SNURS016-FL-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafc-e79c-7641-8b24-c61c79a06b8a01a0eafc-e7a6-7dfc-9006-bd7f89526d60NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafc-e79c-7641-8b24-c61bb33179cf01a0eafc-e7a6-7dfc-9006-bd7f89526d60NovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafc-4a80-78c6-bfbe-db79a662c6e701a0eafc-4aa0-7a25-96a2-7afa2738f1dbLiraLock® Instrument SNURS016-FL-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafc-4a80-78c6-bfbe-db7a0909a1af01a0eafc-4aa0-7a25-96a2-7afa2738f1dbLiraLock® Instrument SNURS016-FL-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafc-4a80-78c6-bfbe-db7cde6799cf01a0eafc-4aa0-7a25-96a2-7afa2738f1dbNovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafc-4a80-78c6-bfbe-db7b346fe7d001a0eafc-4aa0-7a25-96a2-7afa2738f1dbNovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false
01a0eafc-4a80-78c6-bfbe-db7d12d256d201a0eafc-4aa0-7a25-96a2-7afa2738f1dbNovaPatch® PETURS016-SP-001NULLa6e7f8a9-b0c1-2345-0123-456789012345false

Inventory history records bill_only_order removals — ✅ PASS

Section titled “Inventory history records bill_only_order removals — ✅ PASS”

Assertion: Inventory history should contain records with action=removed and reason=bill_only_order

SELECT ih.id, ih.item_id, ih.quantity, ih.status, ih.info,
ih.created_at, ih.inventory_id
FROM inventory_history ih
WHERE ih.item_id IN (
SELECT id FROM inventory_items
WHERE real_world_location_id = $1
AND lot IN ($2, $3)
)
AND ih.created_at > NOW() - INTERVAL '30 minutes'
AND ih.info->>'action' = 'removed'
AND ih.info->>'reason' = 'bill_only_order'
ORDER BY ih.created_at DESC
LIMIT 20
iditem_idquantitystatusinfocreated_atinventory_id
01a0eafd-6c0b-7f6c-b64b-4d1943751c044f8551d2-ec58-4abf-b6df-b50b8d725a0615ready{"action":"removed","reason":"bill_only_order","bestEffort":true,"billingOrderId":"01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3","shortageQuantity":0,"requestedQuantity":15}2026-09-29T02:27:51.885Zfa000001-0000-4000-8000-000000000001
01a0eafd-6c0b-7f6c-b64b-4d1ae89ee1664f8551d2-ec58-4abf-b6df-b50b8d725a065ready{"action":"removed","reason":"bill_only_order","bestEffort":true,"billingOrderId":"01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3","shortageQuantity":5,"requestedQuantity":20}2026-09-29T02:27:51.885Zfa000001-0000-4000-8000-000000000001
01a0eafc-e7b0-74f6-b3ef-9fbf886fed15349f34d2-a717-4429-9fa1-fd4762591b7a1ready{"action":"removed","reason":"bill_only_order","bestEffort":true,"billingOrderId":"01a0eafc-e7a6-7dfc-9006-bd7f89526d60","shortageQuantity":0,"requestedQuantity":1}2026-09-29T02:27:18.004Zfa000001-0000-4000-8000-000000000001
01a0eafc-e7b0-74f6-b3ef-9fc0d26f4dd64f8551d2-ec58-4abf-b6df-b50b8d725a062ready{"action":"removed","reason":"bill_only_order","bestEffort":true,"billingOrderId":"01a0eafc-e7a6-7dfc-9006-bd7f89526d60","shortageQuantity":0,"requestedQuantity":2}2026-09-29T02:27:18.004Zfa000001-0000-4000-8000-000000000001
01a0eafc-4b08-74c7-9836-20aa5ae0667f349f34d2-a717-4429-9fa1-fd4762591b7a2ready{"action":"removed","reason":"bill_only_order","bestEffort":true,"billingOrderId":"01a0eafc-4aa0-7a25-96a2-7afa2738f1db","shortageQuantity":0,"requestedQuantity":2}2026-09-29T02:26:37.635Zfa000001-0000-4000-8000-000000000001
01a0eafc-4b08-74c7-9836-20ab75e07aa74f8551d2-ec58-4abf-b6df-b50b8d725a063ready{"action":"removed","reason":"bill_only_order","bestEffort":true,"billingOrderId":"01a0eafc-4aa0-7a25-96a2-7afa2738f1db","shortageQuantity":0,"requestedQuantity":3}2026-09-29T02:26:37.635Zfa000001-0000-4000-8000-000000000001

Inventory transactions created — ✅ PASS

Section titled “Inventory transactions created — ✅ PASS”

Assertion: Inventory transactions should exist with source_type = bill_only_order

SELECT it.id, it.source_type, it.source_id, it.created_at,
it.distributor_organization_id, it.manufacturer_organization_id
FROM inventory_transactions it
WHERE it.source_type = 'bill_only_order'
AND it.created_at > NOW() - INTERVAL '30 minutes'
AND (it.distributor_organization_id = $1 OR it.manufacturer_organization_id = $1)
ORDER BY it.created_at DESC
LIMIT 10
idsource_typesource_idcreated_atdistributor_organization_idmanufacturer_organization_id
01a0eafd-6c07-72cb-acbe-55e5f0bd758abill_only_order01a0eafd-6bff-7b8d-94bc-e20fd3b6cca32026-09-29T02:27:51.885Zb2c3d4e5-f6a7-8901-bcde-f12345678901NULL
01a0eafc-e7ac-75cb-ad8b-c0e37c52ce38bill_only_order01a0eafc-e7a6-7dfc-9006-bd7f89526d602026-09-29T02:27:18.004Zb2c3d4e5-f6a7-8901-bcde-f12345678901NULL
01a0eafc-4ac2-751e-a62e-b930ac680819bill_only_order01a0eafc-4aa0-7a25-96a2-7afa2738f1db2026-09-29T02:26:37.635Zb2c3d4e5-f6a7-8901-bcde-f12345678901NULL

No negative inventory quantities — ✅ PASS

Section titled “No negative inventory quantities — ✅ PASS”

Assertion: Inventory quantities should never go below zero (CHECK constraint enforced)

SELECT ii.id, ii.lot, ii.quantity_ready
FROM inventory_items ii
WHERE ii.real_world_location_id = $1
AND ii.lot IN ($2, $3)
AND ii.quantity_ready < 0

No rows returned

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.

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.

StepExpected Audit ActionFound
Step 1: Initial inventoryuser_log:user:login✅
Step 2: First orderdecision:bill_only_order.inventory_items_decrement✅
Step 4: Second orderdecision:bill_only_order.inventory_items_decrement✅

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.

StepExpected TemplateFound
Step 2: First orderNew Bill-Only Order✅
Step 4: Second orderNew Bill-Only Order✅
Step 5: Shortage edge caseNew Bill-Only Order✅

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-09-29T02:24:45.485Z

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

47 event(s) captured:

TimeTypeActionUserOrgObject IDPerformedReason
2026-09-29 02:25:17Zuser_loguser:loginblair.bennett@corvetasurgical.comCorveta Surgical Group——
2026-09-29 02:25:29Zuser_loguser:loginblair.bennett@corvetasurgical.comCorveta Surgical Group——
2026-09-29 02:25:41Zdecisionbill_only_order.duplicate_submission_blockblair.bennett@corvetasurgical.comCorveta Surgical Groupfea7b8c9-d0e1-2345-0123-456789012345nono_same_day_candidates
2026-09-29 02:26:37Zdecisionbill_only_order.duplicate_submission_blockblair.bennett@corvetasurgical.comCorveta Surgical Groupfea7b8c9-d0e1-2345-0123-456789012345nono_same_day_candidates
2026-09-29 02:26:37Zdecisionbill_only.link_purchase_orderblair.bennett@corvetasurgical.comCorveta Surgical Group01a0eafc-4aa0-7a25-96a2-7afa2738f1dbnono_purchase_order_selected
2026-09-29 02:26:37Zbilling_orderstatus_changeblair.bennett@corvetasurgical.comVantis01a0eafc-4aa0-7a25-96a2-7afa2738f1db—
2026-09-29 02:26:37Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis01a0eafc-4ba5-7d93-837c-0c79ad1fe38d—
2026-09-29 02:26:37Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis01a0eafc-4bb3-74ec-b974-a151c24142b8—
2026-09-29 02:26:37Zdecisionrepresentatives.gate_rep_actionblair.bennett@corvetasurgical.comVantisa1b2c3d4-e5f6-7890-abcd-ef1234567890nono_blocking_relationship
2026-09-29 02:26:37Zdecisionrepresentatives.gate_rep_actionblair.bennett@corvetasurgical.comVantisa1b2c3d4-e5f6-7890-abcd-ef1234567890nono_blocking_relationship
2026-09-29 02:26:37Zdecisionbill_only_order.inventory_items_decrementblair.bennett@corvetasurgical.comVantis01a0eafc-4aa0-7a25-96a2-7afa2738f1dbyesinventory_items_decremented
2026-09-29 02:26:37Zdecisionbill_only_order.direct_po_import_on_createblair.bennett@corvetasurgical.comVantis01a0eafc-4aa0-7a25-96a2-7afa2738f1dbnoNo uploaded PO documents
2026-09-29 02:26:37ZdecisionbasicErp.deriveSalesOrderblair.bennett@corvetasurgical.comVantis01a0eafc-4aa0-7a25-96a2-7afa2738f1dbnoflag_disabled
2026-09-29 02:26:37Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis01a0eafc-4bb7-78e5-9a71-afb603d670cb—
2026-09-29 02:26:39Zdecisionbill_only.notifications.cc_incident_recipients—Vantis01a0eafc-4aa0-7a25-96a2-7afa2738f1dbnoorder has no no-charge item with an incident reason
2026-09-29 02:26:40Ztransactional_emailnew_bill_only—Corveta Surgical Group01a0eafc-4aa0-7a25-96a2-7afa2738f1db—
2026-09-29 02:26:44Zuser_loguser:loginblair.bennett@corvetasurgical.comCorveta Surgical Group——
2026-09-29 02:26:49Zuser_loguser:loginblair.bennett@corvetasurgical.comCorveta Surgical Group——
2026-09-29 02:27:02Zdecisionbill_only_order.duplicate_submission_blockblair.bennett@corvetasurgical.comCorveta Surgical Groupfea7b8c9-d0e1-2345-0123-456789012345noacknowledged_not_duplicate
2026-09-29 02:27:18ZdecisionbasicErp.deriveSalesOrderblair.bennett@corvetasurgical.comVantis01a0eafc-e7a6-7dfc-9006-bd7f89526d60noflag_disabled
2026-09-29 02:27:18Zdecisionbill_only_order.duplicate_submission_blockblair.bennett@corvetasurgical.comCorveta Surgical Groupfea7b8c9-d0e1-2345-0123-456789012345noacknowledged_not_duplicate
2026-09-29 02:27:18Zdecisionbill_only.link_purchase_orderblair.bennett@corvetasurgical.comCorveta Surgical Group01a0eafc-e7a6-7dfc-9006-bd7f89526d60nono_purchase_order_selected
2026-09-29 02:27:18Zdecisionrepresentatives.gate_rep_actionblair.bennett@corvetasurgical.comVantisa1b2c3d4-e5f6-7890-abcd-ef1234567890nono_blocking_relationship
2026-09-29 02:27:18Zdecisionrepresentatives.gate_rep_actionblair.bennett@corvetasurgical.comVantisa1b2c3d4-e5f6-7890-abcd-ef1234567890nono_blocking_relationship
2026-09-29 02:27:18Zdecisionbill_only_order.inventory_items_decrementblair.bennett@corvetasurgical.comVantis01a0eafc-e7a6-7dfc-9006-bd7f89526d60yesinventory_items_decremented
2026-09-29 02:27:18Zdecisionbill_only_order.direct_po_import_on_createblair.bennett@corvetasurgical.comVantis01a0eafc-e7a6-7dfc-9006-bd7f89526d60noNo uploaded PO documents
2026-09-29 02:27:18Zbilling_orderstatus_changeblair.bennett@corvetasurgical.comVantis01a0eafc-e7a6-7dfc-9006-bd7f89526d60—
2026-09-29 02:27:18Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis01a0eafc-e7bb-7233-8b50-6095b6081e53—
2026-09-29 02:27:18Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis01a0eafc-e7bf-7ebb-a7a8-cf808f53ca0a—
2026-09-29 02:27:18Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis01a0eafc-e7c2-7280-9769-79cfa1b187fb—
2026-09-29 02:27:19Zdecisionbill_only.notifications.cc_incident_recipients—Vantis01a0eafc-e7a6-7dfc-9006-bd7f89526d60noorder has no no-charge item with an incident reason
2026-09-29 02:27:19Ztransactional_emailnew_bill_only—Corveta Surgical Group01a0eafc-e7a6-7dfc-9006-bd7f89526d60—
2026-09-29 02:27:25Zuser_loguser:loginblair.bennett@corvetasurgical.comCorveta Surgical Group——
2026-09-29 02:27:38Zdecisionbill_only_order.duplicate_submission_blockblair.bennett@corvetasurgical.comCorveta Surgical Groupfea7b8c9-d0e1-2345-0123-456789012345noacknowledged_not_duplicate
2026-09-29 02:27:51Zdecisionbill_only_order.inventory_items_decrementblair.bennett@corvetasurgical.comVantis01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3yesinventory_items_decremented
2026-09-29 02:27:51Zdecisionbill_only_order.direct_po_import_on_createblair.bennett@corvetasurgical.comVantis01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3noNo uploaded PO documents
2026-09-29 02:27:51Zbilling_orderstatus_changeblair.bennett@corvetasurgical.comVantis01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3—
2026-09-29 02:27:51ZdecisionbasicErp.deriveSalesOrderblair.bennett@corvetasurgical.comVantis01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3noflag_disabled
2026-09-29 02:27:51Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis01a0eafd-6c19-73d9-ab74-aef85e13df88—
2026-09-29 02:27:51Zdecisionbill_only.link_purchase_orderblair.bennett@corvetasurgical.comCorveta Surgical Group01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3nono_purchase_order_selected
2026-09-29 02:27:51Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis01a0eafd-6c1c-705e-971a-2ae5cda57da8—
2026-09-29 02:27:51Zscheduled_taskscheduled_task.scheduledblair.bennett@corvetasurgical.comVantis01a0eafd-6c1f-75bb-b4e6-68ae36e6ae1e—
2026-09-29 02:27:51Zdecisionrepresentatives.gate_rep_actionblair.bennett@corvetasurgical.comVantisa1b2c3d4-e5f6-7890-abcd-ef1234567890nono_blocking_relationship
2026-09-29 02:27:51Zdecisionrepresentatives.gate_rep_actionblair.bennett@corvetasurgical.comVantisa1b2c3d4-e5f6-7890-abcd-ef1234567890nono_blocking_relationship
2026-09-29 02:27:51Zdecisionbill_only_order.duplicate_submission_blockblair.bennett@corvetasurgical.comCorveta Surgical Groupfea7b8c9-d0e1-2345-0123-456789012345noacknowledged_not_duplicate
2026-09-29 02:27:52Zdecisionbill_only.notifications.cc_incident_recipients—Vantis01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3noorder has no no-charge item with an incident reason
2026-09-29 02:27:52Ztransactional_emailnew_bill_only—Corveta Surgical Group01a0eafd-6bff-7b8d-94bc-e20fd3b6cca3—

3 notification email(s) were captured during this test run. Each email is rendered as a screenshot for compliance review.

1. New Bill-Only Order - 9/29/2026 - Vantis BO-1

Section titled “1. New Bill-Only Order - 9/29/2026 - Vantis BO-1”

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-1

New Bill-Only Order - 9/29/2026 - Vantis BO-1

2. New Bill-Only Order - 9/29/2026 - Vantis BO-2

Section titled “2. New Bill-Only Order - 9/29/2026 - Vantis BO-2”

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-2

New Bill-Only Order - 9/29/2026 - Vantis BO-2

3. New Bill-Only Order - 9/29/2026 - Vantis BO-3

Section titled “3. New Bill-Only Order - 9/29/2026 - Vantis BO-3”

Template: New_Bill-Only_Order_-_9_29_2026_-_Vantis_BO-3

New Bill-Only Order - 9/29/2026 - Vantis BO-3