{
  "InboundEvent": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "eventId": "00000000-0000-4000-8000-000000000003",
    "providerEventId": "provider-demo-1",
    "sessionId": "session-demo",
    "channel": "zalo",
    "threadId": "group-demo",
    "senderId": "driver-demo",
    "text": "",
    "evidenceIds": [
      "00000000-0000-4000-8000-000000000004"
    ],
    "albumId": "album-demo",
    "occurredAt": "2026-09-24T10:00:00Z",
    "direction": "INBOUND"
  },
  "DispatchDecision": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "decisionId": "00000000-0000-4000-8000-000000000005",
    "eventId": "00000000-0000-4000-8000-000000000003",
    "action": "ASSIGN",
    "reason": "Driver evidence submission",
    "policyVersion": 1,
    "assignments": [
      {
        "taskType": "RECEIVE_CONTAINER_SEAL",
        "roleCode": "OPS",
        "input": {
          "submissionId": "album-demo"
        },
        "ordinal": 0
      }
    ],
    "attachTaskId": null
  },
  "TaskEnvelope": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "taskId": "00000000-0000-4000-8000-000000000002",
    "taskType": "RECEIVE_CONTAINER_SEAL",
    "roleCode": "OPS",
    "roleVersion": 1,
    "shipmentId": null,
    "sourceEventIds": [
      "00000000-0000-4000-8000-000000000003"
    ],
    "evidenceIds": [
      "00000000-0000-4000-8000-000000000004"
    ],
    "idempotencyKey": "provider-demo-1:RECEIVE_CONTAINER_SEAL:0",
    "input": {
      "submissionId": "album-demo",
      "evidenceIds": [
        "00000000-0000-4000-8000-000000000004"
      ],
      "caption": "",
      "shipmentId": null
    },
    "parentTaskId": null
  },
  "ContextBundle": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "taskId": "00000000-0000-4000-8000-000000000002",
    "snapshotVersion": 1,
    "facts": [],
    "references": [
      "sop:ops:1"
    ],
    "missingFields": [
      "shipmentId"
    ],
    "budget": {
      "maxTokens": 8000,
      "maxToolCalls": 5,
      "maxImages": 12
    }
  },
  "ExecutionPlan": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "taskId": "00000000-0000-4000-8000-000000000002",
    "planVersion": 1,
    "mode": "FLOW",
    "targetCode": "cont_seal_verification",
    "targetVersion": 1,
    "input": {
      "submissionId": "album-demo"
    },
    "reason": "Configured driver-group evidence flow"
  },
  "ToolCall": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "executionId": "00000000-0000-4000-8000-000000000006",
    "callId": "00000000-0000-4000-8000-000000000007",
    "toolCode": "vision_read_container",
    "toolVersion": 1,
    "arguments": {
      "evidenceIds": [
        "00000000-0000-4000-8000-000000000004"
      ]
    },
    "idempotencyKey": "execution-demo:vision:1"
  },
  "ToolResult": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "executionId": "00000000-0000-4000-8000-000000000006",
    "callId": "00000000-0000-4000-8000-000000000007",
    "status": "SUCCESS",
    "data": {
      "containerNumber": null
    },
    "error": null,
    "receipt": null
  },
  "TaskResult": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "resultId": "00000000-0000-4000-8000-000000000008",
    "taskId": "00000000-0000-4000-8000-000000000002",
    "executionId": "00000000-0000-4000-8000-000000000006",
    "status": "NEEDS_REVIEW",
    "data": {
      "containerNumber": null,
      "sealNumber": null,
      "shipmentId": null,
      "matchStatus": "AMBIGUOUS",
      "fieldEvidence": []
    },
    "evidenceIds": [
      "00000000-0000-4000-8000-000000000004"
    ],
    "proposedEvent": null,
    "errors": []
  },
  "ValidationDecision": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "resultId": "00000000-0000-4000-8000-000000000008",
    "verdict": "REVIEW",
    "ruleVersion": 1,
    "violations": [
      {
        "path": "containerNumber",
        "code": "MISSING",
        "message": "Container unreadable"
      }
    ],
    "acceptedData": {}
  },
  "WorkflowEvent": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "eventId": "00000000-0000-4000-8000-000000000009",
    "instanceId": "00000000-0000-4000-8000-000000000010",
    "aggregateVersion": 2,
    "eventType": "EVIDENCE_REVIEW_REQUIRED",
    "causationId": "00000000-0000-4000-8000-000000000008",
    "data": {
      "reviewId": "00000000-0000-4000-8000-000000000011"
    }
  },
  "OutboundCommand": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "commandId": "00000000-0000-4000-8000-000000000012",
    "taskId": "00000000-0000-4000-8000-000000000013",
    "destination": {
      "channel": "zalo",
      "sessionId": "session-demo",
      "threadId": "result-demo",
      "threadType": "group"
    },
    "text": "NEEDS_REVIEW: ảnh chưa đủ rõ.",
    "evidenceIds": [
      "00000000-0000-4000-8000-000000000004"
    ]
  },
  "DeliveryReceipt": {
    "schemaVersion": "2.0",
    "tenantId": "00000000-0000-4000-8000-000000000001",
    "traceId": "trace-demo-001",
    "commandId": "00000000-0000-4000-8000-000000000012",
    "status": "SENT",
    "providerMessageIds": [
      "provider-receipt-demo"
    ],
    "error": null
  },
  "ReviewDecision": {
    "reviewId": "00000000-0000-4000-8000-000000000011",
    "expectedVersion": 1,
    "decision": "REJECT",
    "correctedData": {},
    "reason": "Yêu cầu ảnh rõ hơn"
  },
  "ContSealInput": {
    "submissionId": "album-demo",
    "evidenceIds": [
      "00000000-0000-4000-8000-000000000004"
    ],
    "caption": "",
    "shipmentId": null
  },
  "ContSealData": {
    "containerNumber": null,
    "sealNumber": null,
    "shipmentId": null,
    "matchStatus": "AMBIGUOUS",
    "fieldEvidence": []
  },
  "FlowGraph": {
    "schemaVersion": "2.0",
    "nodes": [
      {
        "id": "start",
        "type": "start",
        "config": {}
      },
      {
        "id": "read",
        "type": "skill",
        "config": {
          "skillCode": "extract_container_evidence",
          "skillVersion": 1
        }
      },
      {
        "id": "end",
        "type": "end",
        "config": {}
      }
    ],
    "edges": [
      {
        "from": "start",
        "to": "read",
        "outcome": "success"
      },
      {
        "from": "read",
        "to": "end",
        "outcome": "success"
      }
    ]
  }
}
