{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/documents.schema.json",
  "title": "tables/documents.json",
  "description": "The rows of the table documents 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"
      },
      "doc_type": {
        "type": "string"
      },
      "title": {
        "type": "string"
      },
      "locale": {
        "type": "string",
        "enum": [
          "en",
          "pl"
        ]
      },
      "owner_membership_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "review_cycle_months": {
        "type": "integer"
      },
      "next_review_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "latest_version_number": {
        "type": "integer"
      },
      "effective_version_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "acknowledgment_required": {
        "type": "boolean"
      },
      "acknowledgment_interval_months": {
        "type": [
          "integer",
          "null"
        ]
      },
      "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$"
      },
      "archived_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      }
    },
    "required": [
      "id",
      "organization_id",
      "doc_type",
      "title",
      "locale",
      "owner_membership_id",
      "review_cycle_months",
      "next_review_on",
      "latest_version_number",
      "effective_version_id",
      "acknowledgment_required",
      "acknowledgment_interval_months",
      "created_by",
      "created_at",
      "updated_at",
      "archived_at"
    ],
    "additionalProperties": false
  }
}
