{
  "$id": "https://schema.nfh.global/Intent/v2.0",
  "x-iri": "https://schema.nfh.global/Intent/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "A declaration of an intent to transact",
  "title": "Intent",
  "type": "object",
  "properties": {
    "textSearch": {
      "description": "Free text search query for items",
      "type": "string",
      "example": "gaming laptop premium tech"
    },
    "filters": {
      "description": "Filter criteria for items",
      "type": "object",
      "properties": {
        "type": {
          "description": "Type of filter expression",
          "type": "string",
          "enum": [
            "jsonpath"
          ],
          "default": "jsonpath"
        },
        "expression": {
          "description": "Filter expression based on the specified type",
          "type": "string",
          "example": "$[?(@.rating.value >= 4.0 && @.electronic.brand.name == 'Premium Tech')]"
        }
      },
      "required": [
        "type",
        "expression"
      ]
    },
    "spatial": {
      "description": "Optional array of spatial constraints (CQL2-JSON semantics).",
      "type": "array",
      "items": {
        "$ref": "https://schema.nfh.global/SpatialConstraint/v2.0/schema.json"
      }
    },
    "mediaSearch": {
      "$ref": "https://schema.nfh.global/MediaSearch/v2.0/schema.json"
    }
  },
  "additionalProperties": false
}
