{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zywave/json-schema/zywave-assignment-schema.json",
  "title": "Assignment",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zywave-assignment-api-openapi.yml#/components/schemas/Assignment",
  "allOf": [
    {
      "$ref": "#/$defs/AssignmentCreateInfo"
    },
    {
      "type": "object",
      "description": "Employee course assignment.",
      "additionalProperties": false,
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "status": {
          "$ref": "#/$defs/AssignmentStatus"
        },
        "courseName": {
          "type": "string"
        },
        "startedDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "completedDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdUserPrincipalId": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        },
        "updatedDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedUserPrincipalId": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        }
      }
    }
  ],
  "$defs": {
    "AssignmentCreateInfo": {
      "allOf": [
        {
          "$ref": "#/$defs/AssignmentUpdateInfo"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "courseId",
            "accountId",
            "employeeId"
          ],
          "properties": {
            "courseId": {
              "type": "string",
              "format": "guid",
              "minLength": 1
            },
            "accountId": {
              "type": "integer",
              "format": "int32"
            },
            "employeeId": {
              "type": "integer",
              "format": "int32"
            }
          }
        }
      ]
    },
    "AssignmentStatus": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Unknown",
        "NotStarted",
        "Started",
        "Completed"
      ],
      "enum": [
        "Unknown",
        "NotStarted",
        "Started",
        "Completed"
      ]
    },
    "AssignmentUpdateInfo": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "dueDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        }
      }
    }
  }
}