{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title":"Statistic hit",
  "description":"Statistic hit",
  "type":"object",
  "properties":{
    "date":{
      "title":"Hit date",
      "type": "string",
      "format": "date-time"
    },
    "type":{
      "title":"Hit type",
      "type":"string",
      "enum": ["SEARCH"]
    },
    "origin":{
      "title":"Hit origin",
      "type": "integer"
    },
    "sessionId":{
      "title":"Unique id to track a session",
      "type":"string"
    },
    "ip":{
      "title":"Sender ip",
      "type":"string",
      "oneOf": [
        {
          "format": "ipv4"
        },
        {
          "format": "ipv6"
        }
      ]
    },
    "referrer":{
      "title":"Referrer",
      "type":"string"
    },
    "users": {
      "title": "Users",
      "type": "array",
      "items": {
        "title": "User",
        "type": "object",
        "properties": {
          "userId": {
            "title": "User ID",
            "type": "integer"
          },
          "firstName": {
            "title": "User first name",
            "type": "string"
          },
          "lastName": {
            "title": "User last name",
            "type": "string"
          },
          "email": {
            "title": "User e-mail",
            "type": "string"
          }
        }
      }
    },
    "folders": {
      "title": "Folders",
      "type": "array",
      "items": {
        "title": "Folder",
        "type": "object",
        "properties": {
          "folderId": {
            "title": "Folder ID",
            "type": "integer"
          }
        }
      }
    },
    "search": {
      "title":"Search related information",
      "description": "Search related information",
      "type": "object",
      "properties": {
        "resultCount":{
          "title":"Number of results returned by search. If > 0 search was successful",
          "type": "integer"
        },
        "searchType":{
          "title":"Search type",
          "type":"string",
          "enum": [
            "TEXT",
            "FOLDER",
            "ADVANCED"
          ]
        },
        "searchValue":{
          "title":"Search query",
          "type":"string"
        }
      },
      "required": [
        "resultCount",
        "searchType"
      ]
    }
  },
  "required": [
    "date",
    "type",
    "ip",
    "search"
  ],
  "additionalProperties": false
}
