{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.elimi.africa/contracts/events/lms.course.completed.v1.json",
  "title": "lms.course.completed data",
  "description": "data payload for lms.course.completed. Emitted by LMS when completion policy is satisfied. Independent of CAP certificates. CAP may consume this to unblock GAP_TRAINING.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "enrollmentId",
    "courseId",
    "learnerUserId",
    "percentComplete",
    "completedAt"
  ],
  "properties": {
    "enrollmentId": {
      "type": "string"
    },
    "courseId": {
      "type": "string"
    },
    "learnerUserId": {
      "type": "string",
      "description": "Orchestrator User.id"
    },
    "learnerLmsUserId": {
      "type": "string"
    },
    "percentComplete": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
    },
    "certificateId": {
      "type": ["string", "null"]
    },
    "capApplicationId": {
      "type": ["string", "null"],
      "description": "Present when entitlement.source was cap_recommendation"
    },
    "sectorId": {
      "type": ["string", "null"]
    },
    "tradeId": {
      "type": ["string", "null"]
    },
    "unitIds": {
      "type": "array",
      "items": { "type": "string" }
    },
    "completedAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}
