{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Record representing a single completed course.",
      "key": "tid",
      "record": {
        "properties": {
          "agentRef": {
            "description": "The institution or platform offering the course, as a single nested reference mirroring the flat institution / institutionDid / entityRef fields. Additive dual-write: the flat fields remain the source of truth for existing consumers.",
            "ref": "id.sifa.defs#agentRef",
            "type": "ref"
          },
          "completedAt": {
            "description": "Date the course was completed, in YYYY-MM or YYYY-MM-DD format. Omit if unknown. Applies to a course the user took.",
            "type": "string"
          },
          "createdAt": {
            "description": "Client-declared timestamp when this record was originally created.",
            "format": "datetime",
            "type": "string"
          },
          "credential": {
            "description": "AT-URI of the associated id.sifa.profile.certification record (the credential earned from this course), if applicable. A plain at-uri rather than a strongRef so the link tracks the live certification across edits.",
            "format": "at-uri",
            "type": "string"
          },
          "education": {
            "description": "AT-URI of the id.sifa.profile.education record the course was part of, such as a course within a degree. A plain at-uri rather than a strongRef so the link tracks the live education record across edits.",
            "format": "at-uri",
            "type": "string"
          },
          "endedAt": {
            "description": "When the user last taught the course, in YYYY, YYYY-MM or YYYY-MM-DD format. Omit if still teaching it.",
            "type": "string"
          },
          "entityRef": {
            "description": "Portable, app-neutral identifier for the institution or platform the user selected from a resolver dropdown: a Wikidata Q-ID URI (http://www.wikidata.org/entity/Q...), a ROR URI, or an LEI URI. Enables deterministic resolution to a canonical entity even before the organization claims an ATproto account. Absent for free-text entries.",
            "format": "uri",
            "type": "string"
          },
          "institution": {
            "description": "Institution or platform offering the course.",
            "maxGraphemes": 256,
            "maxLength": 2560,
            "type": "string"
          },
          "institutionDid": {
            "description": "DID of the institution or platform's ATproto account, if one exists.",
            "format": "did",
            "type": "string"
          },
          "name": {
            "description": "Course name.",
            "maxGraphemes": 200,
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          },
          "number": {
            "description": "Course number or code (e.g., 'CS101').",
            "maxGraphemes": 50,
            "maxLength": 500,
            "type": "string",
            "x-skos:exactMatch": [
              "schema:courseCode"
            ]
          },
          "position": {
            "description": "AT-URI of the id.sifa.profile.position record the course was part of: taught under it, or taken as part of the job. A plain at-uri rather than a strongRef so the link tracks the live position across edits.",
            "format": "at-uri",
            "type": "string"
          },
          "role": {
            "description": "The user's role in the course. Absent means the user took it. A taught course renders under Teaching.",
            "knownValues": [
              "id.sifa.defs#courseTaken",
              "id.sifa.defs#courseTaught",
              "id.sifa.defs#courseTeachingAssistant"
            ],
            "maxGraphemes": 64,
            "maxLength": 640,
            "type": "string"
          },
          "startedAt": {
            "description": "When the user started teaching the course, in YYYY, YYYY-MM or YYYY-MM-DD format. Applies to a taught or assisted course.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record",
      "x-skos:exactMatch": [
        "schema:Course"
      ]
    }
  },
  "description": "A course completed by the user.",
  "id": "id.sifa.profile.course",
  "lexicon": 1
}
