{
  "ursId": "URS-010",
  "title": "Submit different order types (Bill-Only, Trunk Stock, Direct, Drop-ship)",
  "timestamp": "2026-08-03T23:09:29.620Z",
  "durationMs": 103190,
  "config": {
    "inboxUrl": "http://localhost:39415",
    "dbHost": "localhost",
    "dbPort": 46401,
    "dbName": "cc_repinbox_dev"
  },
  "setup": {
    "status": "pass"
  },
  "scenarios": [
    {
      "name": "Step 1: Login and navigate",
      "status": "pass",
      "description": "Step 1: Login and navigate",
      "screenshots": [
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-01-logged-in.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-01-order-creation-form.png"
      ],
      "explanation": "Proves that Blair Bennett (Corveta sales rep) can authenticate and reach the order creation form. Establishes the user context used for every subsequent submission.",
      "startedAt": "2026-08-03T23:09:33.951Z",
      "finishedAt": "2026-08-03T23:09:37.585Z",
      "videoPath": "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/videos/step-01-login.webm"
    },
    {
      "name": "Step 2: Bill-Only order",
      "status": "pass",
      "description": "Step 2: Bill-Only order",
      "screenshots": [
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-02-bill-only-devices.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-02-bill-only-product.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-02-bill-only-documents.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-02-bill-only-review.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-02-bill-only-submitted.png"
      ],
      "explanation": "A Bill-Only order is created and submitted end-to-end via the /billing/new flow. The rep selects ROSS Surgical as the sales account, uses their own trunk (TRUNK-36) as the inventory source, and adds NovaPatch 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.",
      "expectedEmailTemplates": [
        "bill-only"
      ],
      "expectedAuditActions": [
        "decision:bill_only_order.inventory_items_decrement",
        "billing_order:status_change"
      ],
      "startedAt": "2026-08-03T23:09:51.201Z",
      "finishedAt": "2026-08-03T23:10:04.600Z",
      "videoPath": "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/videos/step-02-bill-only.webm"
    },
    {
      "name": "Step 3: Consignment order",
      "status": "pass",
      "description": "Step 3: Consignment order",
      "screenshots": [
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-03-consignment-step2.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-03-consignment-products.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-03-consignment-review.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-03-consignment-submitted.png"
      ],
      "explanation": "A consignment order is created and submitted end-to-end via /orders/requests/new. The rep selects ROSS Surgical as the delivery location and picks the Consignment order type. The success screen confirms the order_requests row was accepted with order type \"Consignment\".",
      "startedAt": "2026-08-03T23:10:15.135Z",
      "finishedAt": "2026-08-03T23:10:20.995Z",
      "videoPath": "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/videos/step-03-consignment.webm"
    },
    {
      "name": "Step 4: Direct order",
      "status": "pass",
      "description": "Step 4: Direct order",
      "screenshots": [
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-04-direct-step2.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-04-direct-products.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-04-direct-review.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-04-direct-submitted.png"
      ],
      "explanation": "A direct sales order is created and submitted end-to-end via /orders/requests/new. The rep selects Cedar Crest 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\".",
      "startedAt": "2026-08-03T23:10:32.818Z",
      "finishedAt": "2026-08-03T23:10:38.528Z",
      "videoPath": "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/videos/step-04-direct.webm"
    },
    {
      "name": "Step 5: Drop-ship order",
      "status": "pass",
      "description": "Step 5: Drop-ship order",
      "screenshots": [
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-05-dropship-step2.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-05-dropship-products.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-05-dropship-review.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-05-dropship-submitted.png"
      ],
      "explanation": "A drop-ship order is created and submitted end-to-end via /orders/requests/new. The rep selects Lakeside 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\".",
      "startedAt": "2026-08-03T23:10:50.332Z",
      "finishedAt": "2026-08-03T23:10:56.098Z",
      "videoPath": "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/videos/step-05-dropship.webm"
    },
    {
      "name": "Step 6: Orders summary",
      "status": "pass",
      "description": "Step 6: Orders summary",
      "screenshots": [
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-06-orders-list.png",
        "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/step-06-billing-list.png"
      ],
      "explanation": "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.",
      "startedAt": "2026-08-03T23:11:04.900Z",
      "finishedAt": "2026-08-03T23:11:10.604Z",
      "videoPath": "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/videos/step-06-summary.webm"
    }
  ],
  "dbValidations": [
    {
      "name": "Bill-Only order created",
      "query": "SELECT bo.id, bo.order_number, bo.status, bo.sales_account_id,\n        bo.notes, bo.created_at\n      FROM billing_orders bo\n      WHERE bo.created_by_user_id = $1\n        AND bo.notes LIKE '%URS-010%'\n      ORDER BY bo.created_at DESC\n      LIMIT 5",
      "status": "pass",
      "rows": [
        {
          "id": "019fc9e4-2917-795c-8670-24befcaaa8a4",
          "order_number": "BO-1",
          "status": "submitted",
          "sales_account_id": "fea7b8c9-d0e1-2345-0123-456789012345",
          "notes": "URS-010 validation: bill-only",
          "created_at": "2026-08-03T23:10:00.936Z"
        }
      ],
      "assertion": "A billing_orders row tagged URS-010 should exist for Blair"
    },
    {
      "name": "Bill-Only item pulls from Blair's trunk with the seeded lot",
      "query": "SELECT boi.id, boi.billing_order_id, boi.location_id,\n        boi.lot_number, op.title AS product_name,\n        rwl.name AS location_name, rwl.type AS location_type\n      FROM billing_order_items boi\n      JOIN billing_orders bo ON boi.billing_order_id = bo.id\n      LEFT JOIN org_products op ON boi.product_id = op.id\n      LEFT JOIN real_world_locations rwl ON boi.location_id = rwl.id\n      WHERE bo.created_by_user_id = $1\n        AND bo.notes LIKE '%URS-010%'\n        AND boi.lot_number = $2\n      ORDER BY bo.created_at DESC\n      LIMIT 10",
      "status": "pass",
      "rows": [
        {
          "id": "019fc9e4-2913-769c-9bf5-5bbc00f2be7b",
          "billing_order_id": "019fc9e4-2917-795c-8670-24befcaaa8a4",
          "location_id": "a6e7f8a9-b0c1-2345-0123-456789012345",
          "lot_number": "URS010-SP-001",
          "product_name": "NovaPatch® PET",
          "location_name": "TRUNK-36",
          "location_type": "trunk_stock"
        }
      ],
      "assertion": "A billing_order_items row should reference TRUNK-36 and lot URS010-SP-001"
    },
    {
      "name": "Consignment order submitted",
      "query": "SELECT id, request_number, order_type, status, sales_account_id, notes\n      FROM order_requests\n      WHERE requested_by_user_id = $1\n        AND order_type = 'consignment'\n        AND notes LIKE '%URS-010%'\n      ORDER BY created_at DESC\n      LIMIT 1",
      "status": "pass",
      "rows": [
        {
          "id": "019fc9e4-76a7-71ff-9b67-610af63506e7",
          "request_number": "OR-2",
          "order_type": "consignment",
          "status": "submitted",
          "sales_account_id": "fea7b8c9-d0e1-2345-0123-456789012345",
          "notes": "URS-010 validation: consignment"
        }
      ],
      "assertion": "A consignment order_request tagged URS-010 should exist"
    },
    {
      "name": "Direct order submitted",
      "query": "SELECT id, request_number, order_type, status, sales_account_id, notes\n      FROM order_requests\n      WHERE requested_by_user_id = $1\n        AND order_type = 'direct'\n        AND notes LIKE '%URS-010%'\n      ORDER BY created_at DESC\n      LIMIT 1",
      "status": "pass",
      "rows": [
        {
          "id": "019fc9e4-bb55-7013-8c67-eb52c8776325",
          "request_number": "OR-3",
          "order_type": "direct",
          "status": "submitted",
          "sales_account_id": "1fb8c9d0-e1f2-3456-1234-567890123456",
          "notes": "URS-010 validation: direct"
        }
      ],
      "assertion": "A direct order_request tagged URS-010 should exist"
    },
    {
      "name": "Drop-ship order submitted",
      "query": "SELECT id, request_number, order_type, status, sales_account_id, notes\n      FROM order_requests\n      WHERE requested_by_user_id = $1\n        AND order_type = 'dropship'\n        AND notes LIKE '%URS-010%'\n      ORDER BY created_at DESC\n      LIMIT 1",
      "status": "pass",
      "rows": [
        {
          "id": "019fc9e5-0002-7a82-a62c-d8b47b28da1c",
          "request_number": "OR-4",
          "order_type": "dropship",
          "status": "submitted",
          "sales_account_id": "2ac9d0e1-f2a3-4567-2345-678901234567",
          "notes": "URS-010 validation: dropship"
        }
      ],
      "assertion": "A dropship order_request tagged URS-010 should exist"
    },
    {
      "name": "All four order types submitted",
      "query": "SELECT\n        (SELECT COUNT(DISTINCT order_type)::int\n           FROM order_requests\n           WHERE requested_by_user_id = $1\n             AND notes LIKE '%URS-010%'\n             AND order_type IN ('consignment', 'direct', 'dropship')) AS request_type_count,\n        (SELECT COUNT(*)::int\n           FROM billing_orders\n           WHERE created_by_user_id = $1\n             AND notes LIKE '%URS-010%') AS billing_order_count",
      "status": "pass",
      "rows": [
        {
          "request_type_count": 3,
          "billing_order_count": 1
        }
      ],
      "assertion": "All four order types should be present: consignment, direct, dropship (order_requests) plus at least one billing_orders row (Bill-Only)"
    }
  ],
  "overallStatus": "pass",
  "outputDir": "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z",
  "auditStartTime": "2026-08-03T23:09:27.690Z",
  "emailEvidence": [
    {
      "subject": "New Bill-Only Order - 8/3/2026 - Vantis BO-1",
      "template": "New_Bill-Only_Order_-_8_3_2026_-_Vantis_BO-1",
      "screenshotPath": "/home/runner/_work/code/code/validation_test_results/urs-010-submit-order-types/2026-08-03T23-09-29-619Z/screenshots/emails/2026-08-03T23-10-02-826Z-New_Bill-Only_Order_-_8_3_2026_-_Vantis_BO-1.png"
    }
  ],
  "auditEventEvidence": [
    {
      "createdAt": "2026-08-03T23:09:32.361Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "blair.bennett@corvetasurgical.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-08-03T23:09:39.103Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "blair.bennett@corvetasurgical.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-08-03T23:10:00.936Z",
      "eventType": "decision",
      "action": "bill_only_order.direct_po_import_on_create",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e4-2917-795c-8670-24befcaaa8a4",
      "secondaryObjectId": null,
      "payload": {
        "reason": "No uploaded PO documents",
        "performed": false,
        "entityType": "billing_order",
        "fileSourceOrganizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "hasSelectedPurchaseOrderId": false,
        "purchaseOrderDocumentCount": 0
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:00.936Z",
      "eventType": "decision",
      "action": "bill_only.link_purchase_order",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e4-2917-795c-8670-24befcaaa8a4",
      "secondaryObjectId": null,
      "payload": {
        "reason": "no_purchase_order_selected",
        "performed": false,
        "entityType": "billing_order",
        "salesOrganizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "manufacturerOrganizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:00.936Z",
      "eventType": "decision",
      "action": "bill_only_order.inventory_items_decrement",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e4-2917-795c-8670-24befcaaa8a4",
      "secondaryObjectId": null,
      "payload": {
        "reason": "inventory_items_decremented",
        "itemCount": 1,
        "performed": true,
        "entityType": "billing_order",
        "inventorySource": "inventory_items"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:00.936Z",
      "eventType": "billing_order",
      "action": "status_change",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e4-2917-795c-8670-24befcaaa8a4",
      "secondaryObjectId": null,
      "payload": {
        "reason": null,
        "toStatus": "submitted",
        "fromStatus": null,
        "automatedAction": false
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:02.846Z",
      "eventType": "transactional_email",
      "action": "new_bill_only",
      "userEmail": null,
      "userId": null,
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e4-2917-795c-8670-24befcaaa8a4",
      "secondaryObjectId": null,
      "payload": {
        "to": [
          "blair.bennett@corvetasurgical.com"
        ],
        "s3Path": "email-audit/b2c3d4e5-f6a7-8901-bcde-f12345678901/019fc9e4-3050-7bb8-8fa8-2e37c4a498c6/",
        "subject": "New Bill-Only Order - 8/3/2026 - Vantis BO-1",
        "messageId": "dev-console-log",
        "relatedEntityType": "billing_order"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:06.155Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "blair.bennett@corvetasurgical.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-08-03T23:10:20.821Z",
      "eventType": "decision",
      "action": "order_request_created",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e4-76a7-71ff-9b67-610af63506e7",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Order request OR-2 created (importSource=manual)",
        "priority": "normal",
        "itemCount": 1,
        "orderType": "consignment",
        "performed": true,
        "entityType": "order_request",
        "importSource": "manual",
        "requestNumber": "OR-2",
        "selfFulfilled": false,
        "resolvedLocationId": "6ea3b4c5-d6e7-8901-6789-012345678901",
        "resolvedSalesAccountId": "fea7b8c9-d0e1-2345-0123-456789012345",
        "fulfillingOrganizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "requestingOrganizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:20.821Z",
      "eventType": "checklist",
      "action": "checklists.create",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e4-76b4-7895-ab85-f37e54d8ef22",
      "secondaryObjectId": null,
      "payload": {
        "title": "Order OR-2",
        "source": {
          "type": "order_request",
          "orderRequestId": "019fc9e4-76a7-71ff-9b67-610af63506e7"
        }
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:23.836Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "blair.bennett@corvetasurgical.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-08-03T23:10:38.402Z",
      "eventType": "checklist",
      "action": "checklists.create",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e4-bb5f-7081-a20f-86f4da626ed6",
      "secondaryObjectId": null,
      "payload": {
        "title": "Order OR-3",
        "source": {
          "type": "order_request",
          "orderRequestId": "019fc9e4-bb55-7013-8c67-eb52c8776325"
        }
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:38.402Z",
      "eventType": "decision",
      "action": "order_request_created",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e4-bb55-7013-8c67-eb52c8776325",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Order request OR-3 created (importSource=manual)",
        "priority": "normal",
        "itemCount": 1,
        "orderType": "direct",
        "performed": true,
        "entityType": "order_request",
        "importSource": "manual",
        "requestNumber": "OR-3",
        "selfFulfilled": false,
        "resolvedLocationId": "81c5d6e7-f8a9-0123-8901-234567890123",
        "resolvedSalesAccountId": "1fb8c9d0-e1f2-3456-1234-567890123456",
        "fulfillingOrganizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "requestingOrganizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:41.354Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "blair.bennett@corvetasurgical.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-08-03T23:10:55.986Z",
      "eventType": "decision",
      "action": "order_request_created",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e5-0002-7a82-a62c-d8b47b28da1c",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Order request OR-4 created (importSource=manual)",
        "priority": "normal",
        "itemCount": 1,
        "orderType": "dropship",
        "performed": true,
        "entityType": "order_request",
        "importSource": "manual",
        "requestNumber": "OR-4",
        "selfFulfilled": false,
        "resolvedLocationId": "a3e7f8a9-b0c1-2345-0123-456789012345",
        "resolvedSalesAccountId": "2ac9d0e1-f2a3-4567-2345-678901234567",
        "fulfillingOrganizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "requestingOrganizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:55.986Z",
      "eventType": "checklist",
      "action": "checklists.create",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e5-000a-7b2c-be63-582da0f508b7",
      "secondaryObjectId": null,
      "payload": {
        "title": "Order OR-4",
        "source": {
          "type": "order_request",
          "orderRequestId": "019fc9e5-0002-7a82-a62c-d8b47b28da1c"
        }
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:10:58.936Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "blair.bennett@corvetasurgical.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    }
  ],
  "auditQuery": "SELECT\n    ae.created_at,\n    ae.event_type,\n    ae.action,\n    ae.user_id,\n    u.email AS user_email,\n    ae.organization_id,\n    o.name AS organization_name,\n    ae.object_id,\n    ae.secondary_object_id,\n    ae.payload,\n    ae.route,\n    ae.trace_id\n  FROM audit_events ae\n  LEFT JOIN users u ON u.id = ae.user_id\n  LEFT JOIN organizations o ON o.id = ae.organization_id\n  WHERE ae.created_at >= $1\n    AND ae.organization_id = ANY($2::uuid[])\n  ORDER BY ae.created_at ASC",
  "auditAssertions": [
    {
      "stepName": "Step 2: Bill-Only order",
      "expectedAction": "decision:bill_only_order.inventory_items_decrement",
      "found": true
    },
    {
      "stepName": "Step 2: Bill-Only order",
      "expectedAction": "billing_order:status_change",
      "found": true
    }
  ],
  "emailAssertions": [
    {
      "stepName": "Step 2: Bill-Only order",
      "expectedTemplate": "bill-only",
      "found": true
    }
  ]
}