{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/risks.schema.json",
  "title": "tables/risks.json",
  "description": "The rows of the table risks 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"
      },
      "title": {
        "type": "string"
      },
      "description": {
        "type": "string"
      },
      "category": {
        "type": [
          "string",
          "null"
        ]
      },
      "likelihood": {
        "type": "integer"
      },
      "impact": {
        "type": "integer"
      },
      "treatment": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "mitigate",
          "accept",
          "transfer",
          "avoid",
          null
        ]
      },
      "treatment_plan": {
        "type": [
          "string",
          "null"
        ]
      },
      "residual_likelihood": {
        "type": [
          "integer",
          "null"
        ]
      },
      "residual_impact": {
        "type": [
          "integer",
          "null"
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "open",
          "treating",
          "accepted",
          "closed"
        ]
      },
      "owner_membership_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "source_question_id": {
        "type": [
          "string",
          "null"
        ]
      },
      "method_version": {
        "type": "string"
      },
      "accepted_by": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "accepted_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "acceptance_rationale": {
        "type": [
          "string",
          "null"
        ]
      },
      "review_due_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "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",
      "title",
      "description",
      "category",
      "likelihood",
      "impact",
      "treatment",
      "treatment_plan",
      "residual_likelihood",
      "residual_impact",
      "status",
      "owner_membership_id",
      "source_question_id",
      "method_version",
      "accepted_by",
      "accepted_at",
      "acceptance_rationale",
      "review_due_on",
      "created_by",
      "created_at",
      "updated_at",
      "revision"
    ],
    "additionalProperties": false
  }
}
