{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.elimi.africa/contracts/events/cohort.seat_released.v1.json",
  "title": "cohort.seat_released data",
  "description": "data payload for cohort.seat_released. Emitted by CAP or LMS when an organization super admin releases a sponsored seat before certification or offering completion. Same subject as cohort.seat_consumed, plus releasedByUserId. The slot returns to the line item; the seat row is RELEASED, not deleted.",
  "type": "object",
  "additionalProperties": false,
  "required": ["cohortId", "lineItemId", "userId", "releasedByUserId"],
  "properties": {
    "cohortId": {
      "type": "string",
      "minLength": 1
    },
    "lineItemId": {
      "type": "string",
      "minLength": 1,
      "description": "CohortLineItem.id from cohort.activated"
    },
    "userId": {
      "type": "string",
      "minLength": 1,
      "description": "Orchestrator User.id of the learner or candidate"
    },
    "applicationId": {
      "type": "string",
      "minLength": 1,
      "description": "CAP Application.id when the producer is CAP"
    },
    "levelEnrollmentId": {
      "type": "string",
      "minLength": 1,
      "description": "LMS level enrollment id when the producer is LMS"
    },
    "releasedByUserId": {
      "type": "string",
      "minLength": 1,
      "description": "Orchestrator User.id of the organization staff member who released the seat"
    }
  },
  "oneOf": [
    {
      "required": ["applicationId"],
      "properties": { "levelEnrollmentId": false }
    },
    {
      "required": ["levelEnrollmentId"],
      "properties": { "applicationId": false }
    }
  ]
}
