{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Agent Feedback",
  "type": "object",
  "required": ["document_id", "applicant_id", "document_type", "category", "subcategory", "agent", "target", "feedback_summary"],
  "properties": {
    "document_id": { "type": "string" },
    "applicant_id": { "type": "string" },
    "document_type": { "type": "string", "const": "agent-feedback" },
    "category": { "type": "string", "const": "advisory" },
    "subcategory": { "type": "string", "const": "migration_agent_review" },
    "agent": {
      "type": "object",
      "required": ["full_name", "company", "review_date"],
      "properties": {
        "full_name": { "type": "string" },
        "company": { "type": "string" },
        "review_date": { "type": "string", "format": "date" }
      }
    },
    "target": {
      "type": "object",
      "required": ["occupation"],
      "properties": {
        "occupation": { "type": "string" },
        "anzsco": { "type": "string" },
        "assessment_body": { "type": "string" }
      }
    },
    "feedback_summary": {
      "type": "array",
      "items": { "type": "string" }
    },
    "cited_sources": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["title", "url"],
        "properties": {
          "title": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "source_type": { "type": "string" }
        }
      }
    },
    "recommendations": {
      "type": "array",
      "items": { "type": "string" }
    },
    "evaluation_guidance": {
      "type": "object",
      "properties": {
        "weighting_note": { "type": "string" },
        "bias_control": { "type": "string" }
      }
    }
  }
}
