{
  "title": "Current employment position",
  "$id": "https://velocitynetwork.foundation/schemas/employment-current-v1.0",
  "allOf": [
    {
      "$ref": "#/definitions/Employment-base_Schema"
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "default": "Employment"
        },
        "startDate": {
          "$ref": "#/definitions/Date_Schema"
        }
      }
    }
  ],
  "required": [
    "legalEmployer",
    "role",
    "startDate"
  ],
  "definitions": {
    "Employment-base_Schema": {
      "title": "Employment-base",
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "#/definitions/Json-ld-context_Schema"
        },
        "legalEmployer": {
          "$ref": "#/definitions/Organization_Schema"
        },
        "role": {
          "type": "string",
          "description": "The role the person has in the organization.",
          "maxLength": 256
        },
        "description": {
          "type": "string",
          "description": "A detailed description of the position.",
          "maxLength": 2048
        },
        "employmentType": {
          "type": "array",
          "minItems": 1,
          "description": "Any of: Full-time, full-time, Part-time, part-time, Contract, contract, Temporary, temporary, Permanent, permanent, Internship, internship, Other, ohter. ",
          "items": {
            "type": "string",
            "enum": [
              "Contract",
              "Temporary",
              "Permanent",
              "Internship",
              "Full-time",
              "Part-time",
              "Other",
              "contract",
              "temporary",
              "permanent",
              "internship",
              "full-time",
              "part-time",
              "other"
            ]
          }
        },
        "place": {
          "$ref": "#/definitions/Place_Schema"
        },
        "alignment": {
          "type": "array",
          "description": "A public resource to which the employment position is aligned.",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/Alignment_Schema"
          }
        }
      }
    },
    "Json-ld-context_Schema": {
      "title": "json-ld-context",
      "oneOf": [
        {
          "type": "string",
          "maxLength": 2048
        },
        {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "maxLength": 2048
          }
        }
      ],
      "description": "Simplified context for Velocity Publishers to Use"
    },
    "Alignment_Schema": {
      "title": "Alignment",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "default": "AlignmentObject"
        },
        "targetName": {
          "type": "string",
          "description": "Name of the target alignment.",
          "maxLength": 256
        },
        "targetUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL of the target alignment. ",
          "maxLength": 2048
        },
        "targetDescription": {
          "type": "string",
          "description": "Detailed description of the target alignment. ",
          "maxLength": 2048
        },
        "targetCode": {
          "type": "string",
          "description": "Code of the target alignment. ",
          "maxLength": 256
        },
        "targetFramework": {
          "type": "string",
          "description": "The framework to which the target belongs. ",
          "maxLength": 256
        }
      },
      "required": [
        "targetName",
        "targetUrl"
      ]
    },
    "Date_Schema": {
      "title": "Calendar date",
      "type": "string",
      "pattern": "^[1,2]\\d\\d\\d(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\\d|30|31))?)?$"
    },
    "Did_Schema": {
      "title": "DID",
      "type": "string",
      "pattern": "^did:[a-z0-9]+:[A-Za-z0-9._:?=&%;-]+$"
    },
    "Organization_Schema": {
      "title": "Organization",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "default": "Organization"
        },
        "name": {
          "type": "string",
          "description": "The name of the organization.",
          "maxLength": 256
        },
        "identifier": {
          "$ref": "#/definitions/Did_Schema"
        },
        "place": {
          "$ref": "#/definitions/Place_Schema"
        }
      },
      "required": [
        "name",
        "place"
      ]
    },
    "Place_Schema": {
      "title": "Place",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "default": "Place"
        },
        "name": {
          "type": "string",
          "description": "The name of the place, e.g., building name, branch name, etc.",
          "maxLength": 256
        },
        "addressLocality": {
          "type": "string",
          "description": "The locality where the place is, e.g., town or city name.",
          "maxLength": 256
        },
        "addressRegion": {
          "type": "string",
          "pattern": "^[A-Z]{2}(-[A-Z0-9]{1,3})?$",
          "description": "The region where the place is. These are states, provinces, etc. Must be an [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2)",
          "maxLength": 6
        },
        "addressCountry": {
          "type": "string",
          "description": "The country where the place is. Must be an [ISO 3166 2 letter country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)",
          "pattern": "^[A-Z]{2}$",
          "maxLength": 2
        }
      },
      "required": [
        "addressCountry"
      ]
    }
  }
}