{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/personnel.schema.json",
  "title": "tables/personnel.json",
  "description": "The rows of the table personnel 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"
      },
      "label": {
        "type": "string"
      },
      "job_title": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "enum": [
          "employee",
          "contractor"
        ]
      },
      "started_on": {
        "type": "string",
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "ended_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "access_to_sensitive": {
        "type": "boolean"
      },
      "access_granted_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "background_check_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "background_check_reference": {
        "type": [
          "string",
          "null"
        ]
      },
      "clause_confidentiality": {
        "type": "boolean"
      },
      "clause_surviving_obligations": {
        "type": "boolean"
      },
      "contract_signed_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "access_removed_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "exit_reminder_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "membership_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "directory_user_id": {
        "type": [
          "string",
          "null"
        ]
      },
      "directory_source": {
        "type": [
          "string",
          "null"
        ]
      },
      "work_email": {
        "type": [
          "string",
          "null"
        ]
      },
      "directory_synced_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "department": {
        "type": [
          "string",
          "null"
        ]
      },
      "manager_personnel_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "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",
      "label",
      "job_title",
      "kind",
      "started_on",
      "ended_on",
      "access_to_sensitive",
      "access_granted_on",
      "background_check_on",
      "background_check_reference",
      "clause_confidentiality",
      "clause_surviving_obligations",
      "contract_signed_on",
      "access_removed_on",
      "exit_reminder_on",
      "membership_id",
      "directory_user_id",
      "directory_source",
      "work_email",
      "directory_synced_at",
      "department",
      "manager_personnel_id",
      "created_by",
      "created_at",
      "updated_at",
      "revision"
    ],
    "additionalProperties": false
  }
}
