{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/answer_library_entries.schema.json",
  "title": "tables/answer_library_entries.json",
  "description": "The rows of the table answer_library_entries 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"
      },
      "question": {
        "type": "string"
      },
      "answer": {
        "type": "string"
      },
      "status": {
        "type": "string",
        "enum": [
          "draft",
          "approved"
        ]
      },
      "document_ids": {
        "type": "array",
        "items": {
          "type": "string",
          "format": "uuid"
        }
      },
      "owner_membership_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "created_by": {
        "type": "string",
        "format": "uuid"
      },
      "approved_by": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "approved_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "review_due_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "source_refs": {
        "type": [
          "object",
          "array",
          "string",
          "number",
          "boolean",
          "null"
        ]
      },
      "origin": {
        "type": "string",
        "enum": [
          "written",
          "questionnaire",
          "ai_draft"
        ]
      },
      "similar_entry_id": {
        "type": [
          "string",
          "null"
        ],
        "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",
      "question",
      "answer",
      "status",
      "document_ids",
      "owner_membership_id",
      "created_by",
      "approved_by",
      "approved_at",
      "review_due_on",
      "source_refs",
      "origin",
      "similar_entry_id",
      "created_at",
      "updated_at",
      "revision"
    ],
    "additionalProperties": false
  }
}
