{
 "openapi": "3.1.0",
 "info": {
  "title": "Course Enrollments (HRMS)",
  "version": "20261030b",
  "description": "Who is on which course, how far they have got, and what they scored."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "course-enrollments": {
    "type": "object",
    "required": [
     "course_id",
     "employee_id"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "course_id": {
      "type": "string",
      "format": "uuid",
      "description": "Course"
     },
     "employee_id": {
      "type": "string",
      "format": "uuid",
      "description": "Employee"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "enum": [
       "enrolled",
       "in_progress",
       "completed",
       "expired"
      ]
     },
     "completed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Completed on"
     },
     "score": {
      "type": "string",
      "format": "decimal",
      "description": "Score (out of 100)"
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "description": "Due"
     },
     "assigned_on": {
      "type": "string",
      "format": "date",
      "description": "Assigned on",
      "readOnly": true
     },
     "source": {
      "type": "string",
      "description": "Source",
      "readOnly": true
     },
     "rule_id": {
      "type": "string",
      "format": "uuid",
      "description": "Rule id",
      "readOnly": true
     },
     "path_enrollment_id": {
      "type": "string",
      "format": "uuid",
      "description": "Path enrollment id",
      "readOnly": true
     },
     "session_id": {
      "type": "string",
      "format": "uuid",
      "description": "Session id"
     },
     "started_at": {
      "type": "string",
      "format": "date-time",
      "description": "Started at",
      "readOnly": true
     },
     "valid_until": {
      "type": "string",
      "format": "date",
      "description": "Valid until",
      "readOnly": true
     },
     "reminder_count": {
      "type": "integer",
      "description": "Reminder count",
      "readOnly": true
     },
     "last_reminded_on": {
      "type": "string",
      "format": "date",
      "description": "Last reminded on",
      "readOnly": true
     },
     "escalated_on": {
      "type": "string",
      "format": "date",
      "description": "Escalated on",
      "readOnly": true
     },
     "external_ref": {
      "type": "string",
      "description": "External ref",
      "readOnly": true
     },
     "evaluation_requested_on": {
      "type": "string",
      "format": "date",
      "description": "Evaluation requested on",
      "readOnly": true
     },
     "evaluation_reminded_on": {
      "type": "string",
      "format": "date",
      "description": "Evaluation reminded on",
      "readOnly": true
     },
     "evaluation_reminders": {
      "type": "integer",
      "description": "Evaluation reminders",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/hrms/course-enrollments": {
   "get": {
    "summary": "list course-enrollments",
    "operationId": "list_course_enrollments_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create course-enrollments",
    "operationId": "create_course_enrollments_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/course-enrollments/{id}": {
   "get": {
    "summary": "get course-enrollments",
    "operationId": "get_course_enrollments_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change course-enrollments",
    "operationId": "change_course_enrollments_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete course-enrollments",
    "operationId": "delete_course_enrollments_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/course-enrollments/{id}/complete": {
   "post": {
    "summary": "Complete",
    "operationId": "action_course_enrollments_0_6",
    "description": "Body keys: score, completed_at",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/course-enrollments/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_course_enrollments_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}