{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/indicator_measurements.schema.json",
  "title": "tables/indicator_measurements.json",
  "description": "The rows of the table indicator_measurements 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"
      },
      "indicator_id": {
        "type": "string",
        "format": "uuid"
      },
      "measured_on": {
        "type": "string",
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "value": {
        "type": "number"
      },
      "note": {
        "type": "string"
      },
      "measured_by_membership_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "origin": {
        "type": "string",
        "enum": [
          "manual",
          "automated_test"
        ]
      },
      "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",
      "indicator_id",
      "measured_on",
      "value",
      "note",
      "measured_by_membership_id",
      "origin",
      "created_by",
      "created_at",
      "updated_at",
      "revision"
    ],
    "additionalProperties": false
  }
}
