{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/indicators.schema.json",
  "title": "tables/indicators.json",
  "description": "The rows of the table indicators that belong to the workspace, one object per row, keyed by the database's column names.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "organization_id": {
        "type": "string",
        "format": "uuid"
      },
      "name": {
        "type": "string"
      },
      "description": {
        "type": "string"
      },
      "unit": {
        "type": "string"
      },
      "direction": {
        "type": "string",
        "enum": [
          "up",
          "down"
        ]
      },
      "frequency_months": {
        "type": "integer"
      },
      "target": {
        "type": [
          "number",
          "null"
        ]
      },
      "owner_membership_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "started_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "status": {
        "type": "string",
        "enum": [
          "active",
          "retired"
        ]
      },
      "test_key": {
        "type": [
          "string",
          "null"
        ]
      },
      "test_figure": {
        "type": [
          "string",
          "null"
        ]
      },
      "auto_measure_by": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "auto_measure_since": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "created_by": {
        "type": "string",
        "format": "uuid"
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "revision": {
        "type": "integer"
      }
    },
    "required": [
      "id",
      "organization_id",
      "name",
      "description",
      "unit",
      "direction",
      "frequency_months",
      "target",
      "owner_membership_id",
      "started_on",
      "status",
      "test_key",
      "test_figure",
      "auto_measure_by",
      "auto_measure_since",
      "created_by",
      "created_at",
      "updated_at",
      "revision"
    ],
    "additionalProperties": false
  }
}
