{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/evidence_versions.schema.json",
  "title": "tables/evidence_versions.json",
  "description": "The rows of the table evidence_versions 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"
      },
      "evidence_id": {
        "type": "string",
        "format": "uuid"
      },
      "version_number": {
        "type": "integer"
      },
      "file_name": {
        "type": "string"
      },
      "mime_type": {
        "type": "string"
      },
      "size_bytes": {
        "type": "integer"
      },
      "sha256": {
        "type": "string"
      },
      "scan_status": {
        "type": "string",
        "enum": [
          "pending",
          "clean",
          "infected",
          "not_scanned"
        ]
      },
      "uploaded_by": {
        "type": "string",
        "format": "uuid"
      },
      "uploaded_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "superseded_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "integrity_status": {
        "type": "string",
        "enum": [
          "unchecked",
          "intact",
          "mismatch",
          "missing"
        ]
      },
      "integrity_checked_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "integrity_acknowledged_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "integrity_acknowledged_reason": {
        "type": [
          "string",
          "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$"
      }
    },
    "required": [
      "id",
      "organization_id",
      "evidence_id",
      "version_number",
      "file_name",
      "mime_type",
      "size_bytes",
      "sha256",
      "scan_status",
      "uploaded_by",
      "uploaded_at",
      "superseded_at",
      "integrity_status",
      "integrity_checked_at",
      "integrity_acknowledged_at",
      "integrity_acknowledged_reason",
      "created_at"
    ],
    "additionalProperties": false
  }
}
