{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/assessment_responses.schema.json",
  "title": "tables/assessment_responses.json",
  "description": "The rows of the table assessment_responses 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"
      },
      "assessment_id": {
        "type": "string",
        "format": "uuid"
      },
      "question_id": {
        "type": "string"
      },
      "answer_kind": {
        "type": "string",
        "enum": [
          "level",
          "dont_know",
          "not_applicable"
        ]
      },
      "level": {
        "type": [
          "integer",
          "null"
        ]
      },
      "na_justification": {
        "type": [
          "string",
          "null"
        ]
      },
      "na_decision": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "pending",
          "approved",
          "rejected",
          null
        ]
      },
      "na_decided_by": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "na_decided_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "na_decision_note": {
        "type": [
          "string",
          "null"
        ]
      },
      "confidence": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "low",
          "medium",
          "high",
          null
        ]
      },
      "note": {
        "type": [
          "string",
          "null"
        ]
      },
      "owner_membership_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "answered_by": {
        "type": "string",
        "format": "uuid"
      },
      "answered_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "suggested_from": {
        "type": [
          "object",
          "array",
          "string",
          "number",
          "boolean",
          "null"
        ]
      },
      "created_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",
      "assessment_id",
      "question_id",
      "answer_kind",
      "level",
      "na_justification",
      "na_decision",
      "na_decided_by",
      "na_decided_at",
      "na_decision_note",
      "confidence",
      "note",
      "owner_membership_id",
      "answered_by",
      "answered_at",
      "suggested_from",
      "created_at",
      "revision"
    ],
    "additionalProperties": false
  }
}
