{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/training_completions.schema.json",
  "title": "tables/training_completions.json",
  "description": "The rows of the table training_completions 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"
      },
      "personnel_id": {
        "type": "string",
        "format": "uuid"
      },
      "course_id": {
        "type": "string"
      },
      "course_version": {
        "type": "string"
      },
      "course_major": {
        "type": "integer"
      },
      "content_hash": {
        "type": "string"
      },
      "completed_on": {
        "type": "string",
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "completed_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "score": {
        "type": "integer"
      },
      "first_attempt_score": {
        "type": "integer"
      },
      "attempts": {
        "type": "integer"
      },
      "attempt_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "assignment_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "source": {
        "type": "string",
        "enum": [
          "quickiso"
        ]
      },
      "via": {
        "type": "string",
        "enum": [
          "member",
          "link"
        ]
      },
      "membership_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$"
      }
    },
    "required": [
      "id",
      "organization_id",
      "personnel_id",
      "course_id",
      "course_version",
      "course_major",
      "content_hash",
      "completed_on",
      "completed_at",
      "score",
      "first_attempt_score",
      "attempts",
      "attempt_id",
      "assignment_id",
      "source",
      "via",
      "membership_id",
      "created_at"
    ],
    "additionalProperties": false
  }
}
