{
  "ursId": "URS-072",
  "title": "User transfers inventory to another user through the field-transfer lifecycle",
  "timestamp": "2026-08-03T23:05:21.655Z",
  "durationMs": 73828,
  "config": {
    "inboxUrl": "http://localhost:37247",
    "dbHost": "localhost",
    "dbPort": 34769,
    "dbName": "cc_repinbox_dev"
  },
  "setup": {
    "status": "pass"
  },
  "scenarios": [
    {
      "name": "Step 1: Initiate the field transfer",
      "status": "pass",
      "description": "Step 1: Initiate the field transfer",
      "screenshots": [
        "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/step-01-wizard-start.png",
        "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/step-01-products-selected.png",
        "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/step-01-review.png",
        "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/step-01-initiated.png"
      ],
      "explanation": "A Corveta sales rep (Blair Bennett) opens /transfers and initiates a new field transfer to a second rep (Rana Reyes). The wizard collects the destination, the item to move from the seeded source trunk lot, and the shipping mode (\"Ship to recipient\"). Submitting creates the transfer at status pending_receiver_approval, allocates an FT-{n} number, immediately reserves the inventory in transit at the target, and records the opening status change. The initiate path logs a field_transfer.initiate decision. This verifies a rep can start a controlled transfer to another user.",
      "expectedAuditActions": [
        "decision:field_transfer.initiate"
      ],
      "startedAt": "2026-08-03T23:05:59.639Z",
      "finishedAt": "2026-08-03T23:06:13.877Z",
      "videoPath": "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/videos/step-01-initiate.webm"
    },
    {
      "name": "Step 2: Recipient approves the transfer for shipment",
      "status": "pass",
      "description": "Step 2: Recipient approves the transfer for shipment",
      "screenshots": [
        "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/step-02-detail-pending.png",
        "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/step-02-approved.png"
      ],
      "explanation": "The recipient (Rana Reyes) logs in, opens the transfer, and approves it. Because the transfer ships with an external label, approval confirms the ship-to address and advances the transfer from pending_receiver_approval to pending_shipment (the inventory stays reserved in transit). The approval logs a transfer.approve_receiver decision and a transfer_approve_receiver audit event. This verifies the recipient controls whether the transfer proceeds.",
      "expectedAuditActions": [
        "decision:transfer.approve_receiver"
      ],
      "startedAt": "2026-08-03T23:06:18.401Z",
      "finishedAt": "2026-08-03T23:06:20.030Z",
      "videoPath": "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/videos/step-02-approve.webm"
    },
    {
      "name": "Step 3: Sender records the manual shipment",
      "status": "pass",
      "description": "Step 3: Sender records the manual shipment",
      "screenshots": [
        "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/step-03-shipment-form.png",
        "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/step-03-shipped.png"
      ],
      "explanation": "The sender (Blair Bennett) records the manual carrier shipment — carrier and tracking number — which advances the transfer from pending_shipment to in_transit and stamps shipped_at / shipped_by. No inventory moves here (it is already reserved at the target). The shipment logs a transfer.mark_shipped decision and a transfer_mark_shipped audit event. This verifies shipment details are captured against the transfer.",
      "expectedAuditActions": [
        "decision:transfer.mark_shipped"
      ],
      "startedAt": "2026-08-03T23:06:25.985Z",
      "finishedAt": "2026-08-03T23:06:26.789Z",
      "videoPath": "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/videos/step-03-ship.webm"
    },
    {
      "name": "Step 4: Recipient records receipt and completes the transfer",
      "status": "pass",
      "description": "Step 4: Recipient records receipt and completes the transfer",
      "screenshots": [
        "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/step-04-receipt-form.png",
        "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/step-04-completed.png"
      ],
      "explanation": "The recipient (Rana Reyes) records receipt, which writes the inbound-verification checkpoint and then completes the transfer: status becomes completed, received_at / received_by are stamped, and the moved inventory flips from in_transit to ready at the recipient's trunk. Receipt logs a transfer.record_receipt decision and a transfer_record_receipt audit event. This is the primary URS-072 evidence that the transfer completes and the inventory lands at the destination.",
      "expectedAuditActions": [
        "decision:transfer.record_receipt"
      ],
      "startedAt": "2026-08-03T23:06:31.856Z",
      "finishedAt": "2026-08-03T23:06:32.664Z",
      "videoPath": "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/videos/step-04-receive.webm"
    }
  ],
  "dbValidations": [
    {
      "name": "Completed field transfer created for Blair → Rana with shipment details",
      "query": "SELECT id, transfer_number, status, owning_organization_id,\n      requesting_organization_id, initiated_by_user_id, sender_user_id, recipient_user_id,\n      shipping_mode, carrier, tracking_number, shipped_at, shipped_by_user_id,\n      received_at, received_by_user_id, notes, created_at\n    FROM field_transfers\n    WHERE initiated_by_user_id = $1\n      AND requesting_organization_id = $2\n      AND notes LIKE '%URS-072%'\n      AND created_at > NOW() - INTERVAL '2 hours'\n    ORDER BY created_at DESC",
      "status": "pass",
      "rows": [
        {
          "id": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
          "transfer_number": "FT-1",
          "status": "completed",
          "owning_organization_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "requesting_organization_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
          "initiated_by_user_id": "17b8c9d0-e1f2-3456-1234-567890123456",
          "sender_user_id": "17b8c9d0-e1f2-3456-1234-567890123456",
          "recipient_user_id": "28c9d0e1-f2a3-4567-2345-678901234567",
          "shipping_mode": "external_label",
          "carrier": "FedEx",
          "tracking_number": "URS072-TRACK-001",
          "shipped_at": "2026-08-03T23:06:26.557Z",
          "shipped_by_user_id": "17b8c9d0-e1f2-3456-1234-567890123456",
          "received_at": "2026-08-03T23:06:32.427Z",
          "received_by_user_id": "28c9d0e1-f2a3-4567-2345-678901234567",
          "notes": "URS-072 validation run — submitted at 2026-08-03T23:06:09.297Z",
          "created_at": "2026-08-03T23:06:13.697Z"
        }
      ],
      "assertion": "A URS-072 field transfer should exist with status=completed, owning org=Vantis, recipient=Rana, shipping_mode=external_label, carrier=FedEx, tracking=URS072-TRACK-001, and shipped_at/received_at stamped (marker: \"URS-072 validation run\")."
    },
    {
      "name": "Status-change chain records the full shipped lifecycle",
      "query": "SELECT from_status, to_status, created_at\n    FROM field_transfer_status_changes\n    WHERE field_transfer_id = $1\n    ORDER BY created_at ASC",
      "status": "pass",
      "rows": [
        {
          "from_status": null,
          "to_status": "pending_receiver_approval",
          "created_at": "2026-08-03T23:06:13.697Z"
        },
        {
          "from_status": "pending_receiver_approval",
          "to_status": "pending_shipment",
          "created_at": "2026-08-03T23:06:19.803Z"
        },
        {
          "from_status": "pending_shipment",
          "to_status": "in_transit",
          "created_at": "2026-08-03T23:06:26.555Z"
        },
        {
          "from_status": "in_transit",
          "to_status": "pending_inbound_verification",
          "created_at": "2026-08-03T23:06:32.423Z"
        },
        {
          "from_status": "pending_inbound_verification",
          "to_status": "completed",
          "created_at": "2026-08-03T23:06:32.423Z"
        }
      ],
      "assertion": "The field_transfer_status_changes log should record the transitions to pending_receiver_approval, pending_shipment, in_transit, and completed."
    },
    {
      "name": "Item movement fully received",
      "query": "SELECT mi.quantity_expected, mi.quantity_received\n    FROM item_movement_items mi\n    JOIN item_movements m ON m.id = mi.movement_id\n    WHERE m.field_transfer_id = $1",
      "status": "pass",
      "rows": [
        {
          "quantity_expected": 1,
          "quantity_received": 1
        }
      ],
      "assertion": "The transfer's item_movement_items should show quantity_received = quantity_expected (> 0), proving the moved units were received."
    },
    {
      "name": "Moved inventory is available at the recipient's trunk",
      "query": "SELECT id, real_world_location_id, lot, quantity_ready, quantity_in_transit\n    FROM inventory_items\n    WHERE real_world_location_id = $1\n      AND lot = $2\n      AND manufacturer_organization_id = $3\n      AND quantity_ready > 0\n      AND quantity_in_transit = 0",
      "status": "pass",
      "rows": [
        {
          "id": "019fc9e0-b15c-731a-92b7-19302e7a0f46",
          "real_world_location_id": "b7f8a9b0-c1d2-3456-1234-567890123456",
          "lot": "URS072-SHV-001",
          "quantity_ready": 1,
          "quantity_in_transit": 0
        }
      ],
      "assertion": "After receipt, an inventory_items row for lot URS072-SHV-001 should exist at Rana's trunk with quantity_ready > 0 and quantity_in_transit = 0 (the moved units landed and are ready)."
    },
    {
      "name": "Source lot depleted at the sender's trunk",
      "query": "SELECT COALESCE(SUM(quantity_ready), 0)::int AS remaining_ready\n    FROM inventory_items\n    WHERE real_world_location_id = $1\n      AND lot = $2\n      AND manufacturer_organization_id = $3",
      "status": "pass",
      "rows": [
        {
          "remaining_ready": 0
        }
      ],
      "assertion": "After the transfer, the source lot URS072-SHV-001 at Blair's trunk should have quantity_ready = 0 (all transferred units left the source)."
    },
    {
      "name": "Each lifecycle step recorded a decision audit event",
      "query": "SELECT action, object_id, payload, created_at\n    FROM audit_events\n    WHERE created_at >= $1\n      AND event_type = 'decision'\n      AND action = ANY($2)\n      AND object_id = $3\n    ORDER BY created_at ASC",
      "status": "pass",
      "rows": [
        {
          "action": "field_transfer.initiate",
          "object_id": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
          "payload": {
            "reason": "Field transfer initiated",
            "itemCount": 1,
            "performed": true,
            "toteCount": 0,
            "entityType": "field_transfer",
            "recipientOrganizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
            "crossOrgAuthorizationReason": null
          },
          "created_at": "2026-08-03T23:06:13.697Z"
        },
        {
          "action": "transfer.approve_receiver",
          "object_id": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
          "payload": {
            "reason": "Shipped trunk transfer approved for shipment",
            "performed": true,
            "entityType": "field_transfer",
            "shippingMode": "external_label"
          },
          "created_at": "2026-08-03T23:06:19.803Z"
        },
        {
          "action": "transfer.mark_shipped",
          "object_id": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
          "payload": {
            "reason": "Manual shipment label recorded",
            "performed": true,
            "entityType": "field_transfer",
            "shippingMode": "external_label",
            "hasLabelEvidence": false
          },
          "created_at": "2026-08-03T23:06:26.555Z"
        },
        {
          "action": "transfer.record_receipt",
          "object_id": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
          "payload": {
            "reason": "Field transfer receipt recorded and completed",
            "performed": true,
            "entityType": "field_transfer",
            "shippingMode": "external_label",
            "hasReceiptNotes": false,
            "receiptEvidenceCount": 0
          },
          "created_at": "2026-08-03T23:06:32.423Z"
        }
      ],
      "assertion": "The shipped lifecycle should log decision audit events for field_transfer.initiate, transfer.approve_receiver, transfer.mark_shipped, and transfer.record_receipt within the run window."
    }
  ],
  "overallStatus": "pass",
  "outputDir": "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z",
  "auditStartTime": "2026-08-03T23:05:19.795Z",
  "emailEvidence": [
    {
      "subject": "Field Transfer Initiated — FT-1",
      "template": "Field_Transfer_Initiated_—_FT-1",
      "screenshotPath": "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/emails/2026-08-03T23-06-14-904Z-Field_Transfer_Initiated_—_FT-1.png"
    },
    {
      "subject": "Field Transfer Received — FT-1",
      "template": "Field_Transfer_Received_—_FT-1",
      "screenshotPath": "/home/runner/_work/code/code/validation_test_results/urs-072-field-transfer/2026-08-03T23-05-21-655Z/screenshots/emails/2026-08-03T23-06-33-454Z-Field_Transfer_Received_—_FT-1.png"
    }
  ],
  "auditEventEvidence": [
    {
      "createdAt": "2026-08-03T23:05:20.788Z",
      "eventType": "checklist",
      "action": "checklists.create",
      "userEmail": null,
      "userId": null,
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9df-e295-7e5f-9b20-44ed50d0ce8e",
      "secondaryObjectId": null,
      "payload": {
        "title": "Lot expiration review (1 location need attention)",
        "source": {
          "type": "lot_expiration",
          "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
        }
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:05:21.073Z",
      "eventType": "decision",
      "action": "ensure_lot_expiration_checklist",
      "userEmail": null,
      "userId": null,
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "secondaryObjectId": null,
      "payload": {
        "reason": "created_1_reopened_0_already_open_1",
        "performed": true,
        "entityType": "organization"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:05:56.008Z",
      "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:06:13.697Z",
      "eventType": "checklist",
      "action": "checklists.create",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b167-704e-9675-c8186ca712dd",
      "secondaryObjectId": null,
      "payload": {
        "title": "Field Transfer",
        "source": {
          "type": "field_transfer",
          "fieldTransferId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c"
        }
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:13.697Z",
      "eventType": "decision",
      "action": "field_transfer.initiate",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "payload": {
        "reason": "Field transfer initiated",
        "itemCount": 1,
        "performed": true,
        "toteCount": 0,
        "entityType": "field_transfer",
        "recipientOrganizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "crossOrgAuthorizationReason": null
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:13.697Z",
      "eventType": "decision",
      "action": "send_field_transfer_initiated_notification",
      "userEmail": null,
      "userId": null,
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Notifying sender (17b8c9d0-e1f2-3456-1234-567890123456) and recipient (28c9d0e1-f2a3-4567-2345-678901234567)",
        "performed": true,
        "entityType": "field_transfer"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:14.927Z",
      "eventType": "transactional_email",
      "action": "field_transfer_initiated",
      "userEmail": null,
      "userId": null,
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "to": [
          "blair.bennett@corvetasurgical.com",
          "rana.reyes@corvetasurgical.com"
        ],
        "s3Path": "email-audit/a1b2c3d4-e5f6-7890-abcd-ef1234567890/019fc9e0-b5ff-7017-bbdc-7ac254403d80/",
        "subject": "Field Transfer Initiated — FT-1",
        "messageId": "dev-console-log",
        "relatedEntityType": "field_transfer"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:15.464Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "rana.reyes@corvetasurgical.com",
      "userId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "rana.reyes@corvetasurgical.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-08-03T23:06:19.803Z",
      "eventType": "decision",
      "action": "transfer.approve_receiver",
      "userEmail": "rana.reyes@corvetasurgical.com",
      "userId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Shipped trunk transfer approved for shipment",
        "performed": true,
        "entityType": "field_transfer",
        "shippingMode": "external_label"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:19.803Z",
      "eventType": "decision",
      "action": "tickets.checklist_item_resolve.auto_resolve_ticket",
      "userEmail": null,
      "userId": null,
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b16d-7fee-9ad0-f9d5b2eed21f",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Checklist item is not linked to any ticket.",
        "newState": "completed",
        "oldState": "ready",
        "performed": false,
        "entityType": "checklist_item"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:19.803Z",
      "eventType": "decision",
      "action": "field_transfer.approve_for_shipment",
      "userEmail": "rana.reyes@corvetasurgical.com",
      "userId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Field transfer approved for shipment",
        "performed": true,
        "entityType": "field_transfer",
        "addressEdited": false
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:19.803Z",
      "eventType": "transfer",
      "action": "transfer_approve_receiver",
      "userEmail": "rana.reyes@corvetasurgical.com",
      "userId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "toStatus": "pending_shipment",
        "fromStatus": "pending_receiver_approval",
        "shippingMode": "external_label"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:21.635Z",
      "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:06:26.555Z",
      "eventType": "transfer",
      "action": "transfer_mark_shipped",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "carrier": "FedEx",
        "toStatus": "in_transit",
        "shippedAt": "2026-08-03T23:06:26.557Z",
        "fromStatus": "pending_shipment",
        "trackingNumber": "URS072-TRACK-001",
        "shippedByUserId": "17b8c9d0-e1f2-3456-1234-567890123456",
        "shippingPriority": null,
        "labelEvidenceCount": 0
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:26.555Z",
      "eventType": "decision",
      "action": "transfer.mark_shipped",
      "userEmail": "blair.bennett@corvetasurgical.com",
      "userId": "17b8c9d0-e1f2-3456-1234-567890123456",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Manual shipment label recorded",
        "performed": true,
        "entityType": "field_transfer",
        "shippingMode": "external_label",
        "hasLabelEvidence": false
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:28.382Z",
      "eventType": "user_log",
      "action": "user:login",
      "userEmail": "rana.reyes@corvetasurgical.com",
      "userId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": null,
      "secondaryObjectId": null,
      "payload": {
        "email": "rana.reyes@corvetasurgical.com"
      },
      "route": "/login",
      "traceId": "00000000000000000000000000000000"
    },
    {
      "createdAt": "2026-08-03T23:06:32.423Z",
      "eventType": "decision",
      "action": "field_transfer.receive_tote",
      "userEmail": "rana.reyes@corvetasurgical.com",
      "userId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "reason": "No linked totes to transition",
        "performed": false,
        "entityType": "field_transfer"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:32.423Z",
      "eventType": "decision",
      "action": "field_transfer.receive",
      "userEmail": "rana.reyes@corvetasurgical.com",
      "userId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Field transfer receipt completed",
        "performed": true,
        "entityType": "field_transfer"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:32.423Z",
      "eventType": "decision",
      "action": "loan.advanceOnFieldTransferReceipt",
      "userEmail": "rana.reyes@corvetasurgical.com",
      "userId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "reason": "no linked loan",
        "performed": false,
        "entityType": "field_transfer",
        "fieldTransferId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:32.423Z",
      "eventType": "decision",
      "action": "transfer.record_receipt",
      "userEmail": "rana.reyes@corvetasurgical.com",
      "userId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Field transfer receipt recorded and completed",
        "performed": true,
        "entityType": "field_transfer",
        "shippingMode": "external_label",
        "hasReceiptNotes": false,
        "receiptEvidenceCount": 0
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:32.423Z",
      "eventType": "transfer",
      "action": "transfer_record_receipt",
      "userEmail": "rana.reyes@corvetasurgical.com",
      "userId": "28c9d0e1-f2a3-4567-2345-678901234567",
      "organizationName": "Corveta Surgical Group",
      "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "toStatus": "completed",
        "fromStatus": "in_transit",
        "receivedAt": "2026-08-03T23:06:32.427Z",
        "hasReceiptNotes": false,
        "checkpointStatus": "pending_inbound_verification",
        "receivedByUserId": "28c9d0e1-f2a3-4567-2345-678901234567",
        "receiptEvidenceCount": 0
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:32.423Z",
      "eventType": "decision",
      "action": "send_field_transfer_received_notification",
      "userEmail": null,
      "userId": null,
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "reason": "Notifying sender (17b8c9d0-e1f2-3456-1234-567890123456) and recipient (28c9d0e1-f2a3-4567-2345-678901234567)",
        "performed": true,
        "entityType": "field_transfer"
      },
      "route": null,
      "traceId": null
    },
    {
      "createdAt": "2026-08-03T23:06:33.471Z",
      "eventType": "transactional_email",
      "action": "field_transfer_received",
      "userEmail": null,
      "userId": null,
      "organizationName": "Vantis",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "019fc9e0-b151-720d-bfa3-2d2cdb06a86c",
      "secondaryObjectId": null,
      "payload": {
        "to": [
          "blair.bennett@corvetasurgical.com",
          "rana.reyes@corvetasurgical.com"
        ],
        "s3Path": "email-audit/a1b2c3d4-e5f6-7890-abcd-ef1234567890/019fc9e0-fe74-7de8-ad11-178e566d2f54/",
        "subject": "Field Transfer Received — FT-1",
        "messageId": "dev-console-log",
        "relatedEntityType": "field_transfer"
      },
      "route": null,
      "traceId": null
    }
  ],
  "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 1: Initiate the field transfer",
      "expectedAction": "decision:field_transfer.initiate",
      "found": true
    },
    {
      "stepName": "Step 2: Recipient approves the transfer for shipment",
      "expectedAction": "decision:transfer.approve_receiver",
      "found": true
    },
    {
      "stepName": "Step 3: Sender records the manual shipment",
      "expectedAction": "decision:transfer.mark_shipped",
      "found": true
    },
    {
      "stepName": "Step 4: Recipient records receipt and completes the transfer",
      "expectedAction": "decision:transfer.record_receipt",
      "found": true
    }
  ],
  "emailAssertions": []
}