{
  "ursId": "URS-038",
  "title": "Bill-Only status fields visible on main BO page",
  "timestamp": "2026-04-23T03:41:40.950Z",
  "durationMs": 75950,
  "config": {
    "inboxUrl": "http://localhost:64273",
    "dbHost": "localhost",
    "dbPort": 64274,
    "dbName": "cc_repinbox_dev"
  },
  "setup": {
    "status": "pass"
  },
  "scenarios": [
    {
      "name": "Step 1: Main Bill-Only page loads",
      "status": "pass",
      "description": "Step 1: Main Bill-Only page loads",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-01-billing-main-page.png"
      ],
      "explanation": "Logs in as alex.admin@zurimed.com and navigates to /billing with the \"All Orders\" filter active. Confirms the page heading \"Bill Only\" is visible and all four seeded Bill-Only Orders appear in the table.",
      "startedAt": "2026-04-23T03:41:47.233Z",
      "finishedAt": "2026-04-23T03:41:47.233Z",
      "videoPath": "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/videos/step-01-navigate-to-billing.webm"
    },
    {
      "name": "Step 2: Status column visible",
      "status": "pass",
      "description": "Step 2: Status column visible",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-02-status-column-visible.png"
      ],
      "explanation": "Asserts a sortable \"Status\" column header is rendered in the Bill-Only Orders DataTable. The column must be present for any status badge to be associated with a specific order row.",
      "startedAt": "2026-04-23T03:41:53.409Z",
      "finishedAt": "2026-04-23T03:41:53.409Z",
      "videoPath": "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/videos/step-02-status-column-visible.webm"
    },
    {
      "name": "Step 3: ZBO-2025-001 status badge",
      "status": "pass",
      "description": "Step 3: ZBO-2025-001 status badge",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-03-zbo-2025-001-status-badge.png"
      ],
      "explanation": "Confirms that ZBO-2025-001 (status: draft) displays the \"Draft\" badge label in its table row. Maps to URS-038 BO-001: enteredInQb=false, invoiced=false.",
      "startedAt": "2026-04-23T03:42:02.186Z",
      "finishedAt": "2026-04-23T03:42:02.186Z",
      "videoPath": "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/videos/step-03-status-badges-per-bo.webm"
    },
    {
      "name": "Step 3: ZBO-2025-002 status badge",
      "status": "pass",
      "description": "Step 3: ZBO-2025-002 status badge",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-03-zbo-2025-002-status-badge.png"
      ],
      "explanation": "Confirms that ZBO-2025-002 (status: submitted) displays the \"Submitted\" badge label. Maps to URS-038 BO-002: enteredInQb=false, invoiced=false (awaiting QB entry).",
      "startedAt": "2026-04-23T03:42:04.059Z",
      "finishedAt": "2026-04-23T03:42:04.059Z"
    },
    {
      "name": "Step 3: ZBO-2025-003 status badge",
      "status": "pass",
      "description": "Step 3: ZBO-2025-003 status badge",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-03-zbo-2025-003-status-badge.png"
      ],
      "explanation": "Confirms that ZBO-2025-003 (status: invoice_sent) displays the \"Invoice Sent\" badge label. Maps to URS-038 BO-003: enteredInQb=true, invoiced=true.",
      "startedAt": "2026-04-23T03:42:05.925Z",
      "finishedAt": "2026-04-23T03:42:05.925Z"
    },
    {
      "name": "Step 3: ZBO-2025-004 status badge",
      "status": "pass",
      "description": "Step 3: ZBO-2025-004 status badge",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-03-zbo-2025-004-status-badge.png"
      ],
      "explanation": "Confirms that ZBO-2025-004 (status: invoice_voided) displays the \"Invoice Voided\" badge label. Maps to URS-038 BO-004: enteredInQb=true, invoiced=true (voided edge case).",
      "startedAt": "2026-04-23T03:42:07.825Z",
      "finishedAt": "2026-04-23T03:42:07.825Z"
    },
    {
      "name": "Step 4: Status badges color styling",
      "status": "pass",
      "description": "Step 4: Status badges color styling",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-04-status-badges-color-styling.png"
      ],
      "explanation": "Verifies each status badge renders with the Tailwind color class configured in billingStatusConfig: Draft=bg-gray-100, Submitted=bg-blue-100, Invoice Sent=bg-blue-100, Invoice Voided=bg-red-100. Note: Submitted and Invoice Sent intentionally share the same color class.",
      "startedAt": "2026-04-23T03:42:12.193Z",
      "finishedAt": "2026-04-23T03:42:12.193Z",
      "videoPath": "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/videos/step-04-status-badge-colors.webm"
    },
    {
      "name": "Step 5: Filter by Invoice Voided",
      "status": "pass",
      "description": "Step 5: Filter by Invoice Voided",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-05-filter-invoice-voided.png"
      ],
      "explanation": "Navigates to /billing?filter=invoice_voided and confirms only ZBO-2025-004 is shown. All other seeded orders must be absent from the rendered table, proving the filter correctly narrows the list to one lifecycle stage.",
      "startedAt": "2026-04-23T03:42:19.048Z",
      "finishedAt": "2026-04-23T03:42:19.048Z",
      "videoPath": "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/videos/step-05-status-filter.webm"
    },
    {
      "name": "Step 5: Filter by Submitted",
      "status": "pass",
      "description": "Step 5: Filter by Submitted",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-05-filter-submitted.png"
      ],
      "explanation": "Navigates to /billing?filter=submitted and confirms only ZBO-2025-002 is shown. All other seeded orders must be absent, proving the filter correctly narrows the list.",
      "startedAt": "2026-04-23T03:42:21.656Z",
      "finishedAt": "2026-04-23T03:42:21.656Z"
    },
    {
      "name": "Step 6: Sort by status (asc)",
      "status": "pass",
      "description": "Step 6: Sort by status (asc)",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-06-sort-status-asc.png"
      ],
      "explanation": "Navigates to /billing?filter=all&sortBy=status&sortOrder=asc and confirms the four seeded BOs appear in alphabetical enum order: draft, invoice_sent, invoice_voided, submitted.",
      "startedAt": "2026-04-23T03:42:28.235Z",
      "finishedAt": "2026-04-23T03:42:28.235Z",
      "videoPath": "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/videos/step-06-status-sort.webm"
    },
    {
      "name": "Step 6: Sort by status (desc)",
      "status": "pass",
      "description": "Step 6: Sort by status (desc)",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-06-sort-status-desc.png"
      ],
      "explanation": "Navigates to /billing?filter=all&sortBy=status&sortOrder=desc and confirms the four seeded BOs appear in reverse alphabetical enum order, validating bidirectional sort.",
      "startedAt": "2026-04-23T03:42:29.074Z",
      "finishedAt": "2026-04-23T03:42:29.074Z"
    },
    {
      "name": "Step 7: Status visible on detail page",
      "status": "pass",
      "description": "Step 7: Status visible on detail page",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-07-detail-page-status.png"
      ],
      "explanation": "Drills into ZBO-2025-003 (Invoice Sent) and confirms the \"Invoice Sent\" badge label is visible on the BO detail page. The same status badge component used in the list must also render on the detail view.",
      "startedAt": "2026-04-23T03:42:36.031Z",
      "finishedAt": "2026-04-23T03:42:36.031Z",
      "videoPath": "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/videos/step-07-detail-page-status.webm"
    },
    {
      "name": "Step 8: Status persistence",
      "status": "pass",
      "description": "Step 8: Status persistence",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-08-before-refresh.png",
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-08-after-refresh.png"
      ],
      "explanation": "Captures the status badges before and after a navigation-away + hard refresh cycle. Confirms all four badge labels remain unchanged, proving status is persisted in the database and not held only in client-side state.",
      "startedAt": "2026-04-23T03:42:42.416Z",
      "finishedAt": "2026-04-23T03:42:44.961Z",
      "videoPath": "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/videos/step-08-persistence.webm"
    },
    {
      "name": "Step 9: Responsive layout",
      "status": "pass",
      "description": "Step 9: Responsive layout",
      "screenshots": [
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-09-1920x1080.png",
        "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/screenshots/step-09-1366x768.png"
      ],
      "explanation": "Verifies the Status column and badge labels remain visible across two desktop viewport sizes: 1920×1080 (wide) and 1366×768 (narrow). Confirms the column is not hidden or truncated at common desktop resolutions.",
      "startedAt": "2026-04-23T03:42:50.705Z",
      "finishedAt": "2026-04-23T03:42:54.861Z",
      "videoPath": "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/videos/step-09-responsive-1366x768.webm"
    }
  ],
  "dbValidations": [
    {
      "name": "All four seeded Bill-Only Orders have the expected status enum values",
      "query": "\n    SELECT order_number, status, manufacturer_organization_id\n      FROM billing_orders\n     WHERE order_number = ANY($1)\n     ORDER BY order_number",
      "status": "pass",
      "rows": [
        {
          "order_number": "ZBO-2025-001",
          "status": "draft",
          "manufacturer_organization_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
        },
        {
          "order_number": "ZBO-2025-002",
          "status": "submitted",
          "manufacturer_organization_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
        },
        {
          "order_number": "ZBO-2025-003",
          "status": "invoice_sent",
          "manufacturer_organization_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
        },
        {
          "order_number": "ZBO-2025-004",
          "status": "invoice_voided",
          "manufacturer_organization_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
        }
      ],
      "assertion": "ZBO-2025-001..004 must exist with statuses ZBO-2025-001=draft, ZBO-2025-002=submitted, ZBO-2025-003=invoice_sent, ZBO-2025-004=invoice_voided"
    },
    {
      "name": "All four BOs belong to the ZuriMED manufacturer organization",
      "query": "\n    SELECT manufacturer_organization_id, count(*)::int AS bo_count\n      FROM billing_orders\n     WHERE order_number = ANY($1)\n     GROUP BY manufacturer_organization_id",
      "status": "pass",
      "rows": [
        {
          "manufacturer_organization_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "bo_count": 4
        }
      ],
      "assertion": "All 4 BOs should be owned by ZuriMED"
    },
    {
      "name": "Seeded BOs span four distinct status values",
      "query": "\n    SELECT DISTINCT status\n      FROM billing_orders\n     WHERE order_number = ANY($1)\n     ORDER BY status",
      "status": "pass",
      "rows": [
        {
          "status": "draft"
        },
        {
          "status": "invoice_sent"
        },
        {
          "status": "invoice_voided"
        },
        {
          "status": "submitted"
        }
      ],
      "assertion": "Four seeded BOs should have 4 distinct status values"
    }
  ],
  "overallStatus": "pass",
  "outputDir": "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z",
  "auditStartTime": "2026-04-23T03:41:39.014Z",
  "auditEventEvidence": [
    {
      "createdAt": "2026-04-23T03:41:43.208Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "alex.admin@zurimed.com",
      "userId": "f6a7b8c9-d0e1-2345-f123-456789012345",
      "organizationName": "ZuriMED",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "alex.admin@zurimed.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-04-23T03:41:50.202Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "alex.admin@zurimed.com",
      "userId": "f6a7b8c9-d0e1-2345-f123-456789012345",
      "organizationName": "ZuriMED",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "alex.admin@zurimed.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-04-23T03:41:56.601Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "alex.admin@zurimed.com",
      "userId": "f6a7b8c9-d0e1-2345-f123-456789012345",
      "organizationName": "ZuriMED",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "alex.admin@zurimed.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-04-23T03:42:08.901Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "alex.admin@zurimed.com",
      "userId": "f6a7b8c9-d0e1-2345-f123-456789012345",
      "organizationName": "ZuriMED",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "alex.admin@zurimed.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-04-23T03:42:15.805Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "alex.admin@zurimed.com",
      "userId": "f6a7b8c9-d0e1-2345-f123-456789012345",
      "organizationName": "ZuriMED",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "alex.admin@zurimed.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-04-23T03:42:24.791Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "alex.admin@zurimed.com",
      "userId": "f6a7b8c9-d0e1-2345-f123-456789012345",
      "organizationName": "ZuriMED",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "alex.admin@zurimed.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-04-23T03:42:32.061Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "alex.admin@zurimed.com",
      "userId": "f6a7b8c9-d0e1-2345-f123-456789012345",
      "organizationName": "ZuriMED",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "alex.admin@zurimed.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-04-23T03:42:39.153Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "alex.admin@zurimed.com",
      "userId": "f6a7b8c9-d0e1-2345-f123-456789012345",
      "organizationName": "ZuriMED",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "alex.admin@zurimed.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-04-23T03:42:47.918Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "alex.admin@zurimed.com",
      "userId": "f6a7b8c9-d0e1-2345-f123-456789012345",
      "organizationName": "ZuriMED",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "alex.admin@zurimed.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-04-23T03:42:52.132Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "alex.admin@zurimed.com",
      "userId": "f6a7b8c9-d0e1-2345-f123-456789012345",
      "organizationName": "ZuriMED",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "alex.admin@zurimed.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": [],
  "emailAssertions": [],
  "videoPaths": [
    "/Users/jason/projects/casecohort/code/validation_test_results/urs-038-bill-only-status-fields/2026-04-23T03-41-40-948Z/videos/step-09-responsive-1920x1080.webm"
  ]
}