{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/applicant-profile-protocol/latest.json",
  "title": "Applicant Profile Protocol (APP) v1",
  "x-lintel": {
    "source": "https://app-protocol.org/schema/app-1.0.json",
    "sourceSha256": "8a8c12223091bbdced69908637d7d0ed1f169497de0d081312511307c8b84e6f",
    "fileMatch": [
      "*.app.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "protocol": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "const": "ApplicantProfileProtocol"
        },
        "shortName": {
          "type": "string",
          "const": "APP"
        },
        "version": {
          "type": "string",
          "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
        },
        "uri": {
          "type": "string",
          "format": "uri"
        },
        "id": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "version",
        "id"
      ],
      "additionalProperties": false
    },
    "basics": {
      "$ref": "#/$defs/basics"
    },
    "experience": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/experience"
      }
    },
    "education": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/education"
      }
    },
    "skills": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/skill"
      }
    },
    "projects": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/project"
      }
    },
    "credentials": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/credential"
      }
    },
    "languages": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/language"
      }
    },
    "preferences": {
      "$ref": "#/$defs/preferences"
    },
    "metadata": {
      "$ref": "#/$defs/metadata"
    },
    "semantic": {
      "type": "object",
      "description": "Optional JSON-LD overlay",
      "additionalProperties": true
    },
    "enrichment": {
      "type": "object",
      "description": "Optional computed metrics",
      "additionalProperties": true
    },
    "evidence": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/evidenceItem"
      }
    }
  },
  "required": [
    "protocol",
    "basics"
  ],
  "additionalProperties": false,
  "$defs": {
    "dateYearMonth": {
      "type": "string",
      "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
    },
    "year": {
      "type": "string",
      "pattern": "^\\d{4}$"
    },
    "uri": {
      "type": "string",
      "format": "uri"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "phone": {
      "type": "string",
      "minLength": 5,
      "maxLength": 30
    },
    "personName": {
      "type": "object",
      "properties": {
        "given": {
          "type": "string",
          "minLength": 1
        },
        "family": {
          "type": "string",
          "minLength": 1
        },
        "middle": {
          "type": "string"
        },
        "suffix": {
          "type": "string"
        }
      },
      "required": [
        "given",
        "family"
      ],
      "additionalProperties": false
    },
    "location": {
      "type": "object",
      "properties": {
        "country": {
          "type": "string",
          "minLength": 2
        },
        "region": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "remote": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "link": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string"
        },
        "url": {
          "$ref": "#/$defs/uri"
        }
      },
      "required": [
        "label",
        "url"
      ],
      "additionalProperties": false
    },
    "contact": {
      "type": "object",
      "properties": {
        "email": {
          "$ref": "#/$defs/email"
        },
        "phone": {
          "$ref": "#/$defs/phone"
        },
        "website": {
          "$ref": "#/$defs/uri"
        },
        "social": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/link"
          }
        }
      },
      "additionalProperties": false
    },
    "basics": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/personName"
        },
        "headline": {
          "type": "string",
          "maxLength": 200
        },
        "summary": {
          "type": "string",
          "maxLength": 2000
        },
        "location": {
          "$ref": "#/$defs/location"
        },
        "contact": {
          "$ref": "#/$defs/contact"
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/link"
          }
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "organization": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "industry": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "experience": {
      "type": "object",
      "properties": {
        "role": {
          "type": "string"
        },
        "organization": {
          "$ref": "#/$defs/organization"
        },
        "start": {
          "$ref": "#/$defs/dateYearMonth"
        },
        "end": {
          "$ref": "#/$defs/dateYearMonth"
        },
        "current": {
          "type": "boolean"
        },
        "location": {
          "$ref": "#/$defs/location"
        },
        "employmentType": {
          "type": "string",
          "enum": [
            "Full-time",
            "Part-time",
            "Contract",
            "Internship",
            "Temporary"
          ]
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 500
          }
        },
        "technologies": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "metrics": {
          "type": "object",
          "additionalProperties": true
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/link"
          }
        }
      },
      "required": [
        "role",
        "organization",
        "start"
      ],
      "additionalProperties": false
    },
    "education": {
      "type": "object",
      "properties": {
        "institution": {
          "type": "string"
        },
        "area": {
          "type": "string"
        },
        "degree": {
          "type": "string"
        },
        "start": {
          "$ref": "#/$defs/year"
        },
        "end": {
          "$ref": "#/$defs/year"
        },
        "completed": {
          "type": "boolean"
        },
        "grade": {
          "type": "string"
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/link"
          }
        }
      },
      "required": [
        "institution"
      ],
      "additionalProperties": false
    },
    "skill": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "category": {
          "type": "string",
          "enum": [
            "ProgrammingLanguage",
            "Framework",
            "Library",
            "Tool",
            "CloudService",
            "Platform",
            "Datastore",
            "Methodology",
            "SoftSkill",
            "Domain"
          ]
        },
        "level": {
          "type": "string",
          "enum": [
            "Beginner",
            "Intermediate",
            "Advanced",
            "Expert"
          ]
        },
        "years": {
          "type": "number",
          "minimum": 0,
          "maximum": 60
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "usage": {
          "type": "object",
          "properties": {
            "lastUsed": {
              "$ref": "#/$defs/dateYearMonth"
            },
            "contexts": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "evidenceRef": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "project": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "stack": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "website": {
              "$ref": "#/$defs/uri"
            },
            "repository": {
              "$ref": "#/$defs/uri"
            }
          },
          "additionalProperties": false
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "credential": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "issuer": {
          "type": "string"
        },
        "date": {
          "$ref": "#/$defs/dateYearMonth"
        },
        "id": {
          "type": "string"
        },
        "url": {
          "$ref": "#/$defs/uri"
        }
      },
      "required": [
        "name",
        "issuer"
      ],
      "additionalProperties": false
    },
    "language": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "proficiency": {
          "type": "string",
          "enum": [
            "Basic",
            "Conversational",
            "Professional",
            "Fluent",
            "Native"
          ]
        }
      },
      "required": [
        "name",
        "proficiency"
      ],
      "additionalProperties": false
    },
    "preferences": {
      "type": "object",
      "properties": {
        "employmentType": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "Full-time",
              "Part-time",
              "Contract",
              "Internship",
              "Temporary"
            ]
          }
        },
        "workMode": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "Onsite",
              "Remote",
              "Hybrid"
            ]
          }
        },
        "relocation": {
          "type": "boolean"
        },
        "preferredLocations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "metadata": {
      "type": "object",
      "properties": {
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "updated": {
          "type": "string",
          "format": "date-time"
        },
        "source": {
          "type": "string",
          "enum": [
            "SelfReported",
            "Imported",
            "Generated"
          ]
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "evidenceItem": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Certificate",
            "URL",
            "Document",
            "Hash",
            "VerifiableCredential"
          ]
        },
        "url": {
          "$ref": "#/$defs/uri"
        },
        "description": {
          "type": "string"
        },
        "hash": {
          "type": "object",
          "properties": {
            "algorithm": {
              "type": "string"
            },
            "value": {
              "type": "string"
            }
          },
          "required": [
            "algorithm",
            "value"
          ],
          "additionalProperties": false
        },
        "refId": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false
    }
  }
}
