Skip to content

Training Enrollments (التسجيلات)

Enroll employees in training sessions and track attendance, completion, scores, and feedback.

Attributes

FieldTypeDescription
idintegerPrimary key
training_session_idintegerSession FK
employee_idintegerEmployee FK
statusenumenrolled, attended, completed, cancelled, no_show
attendance_confirmedbooleanAttendance confirmed
scoredecimalAssessment score (nullable)
feedbacktextEmployee feedback (nullable)
enrolled_atdatetimeEnrollment timestamp
completed_atdatetimeCompletion timestamp (nullable)

API Endpoints

MethodURLDescription
GET/api/hr/training-enrollmentsList enrollments
POST/api/hr/training-enrollmentsEnroll employee
PUT/api/hr/training-enrollments/{id}Update enrollment (mark attended, score, etc.)

Query Parameters

ParameterTypeDescription
training_session_idintegerFilter by session
employee_idintegerFilter by employee
statusstringFilter by status

Examples

bash
# Enroll employee
curl -X POST "https://moon-erp.elbaset.com/api/hr/training-enrollments" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "training_session_id": 1,
    "employee_id": 5
  }'

# Mark as completed with score
curl -X PUT "https://moon-erp.elbaset.com/api/hr/training-enrollments/1" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "completed",
    "attendance_confirmed": true,
    "score": 92.5,
    "feedback": "Excellent training program"
  }'
dart
// Enroll
final response = await dio.post('/api/hr/training-enrollments', data: {
  'training_session_id': 1,
  'employee_id': 5,
});

// Mark completed
await dio.put('/api/hr/training-enrollments/1', data: {
  'status': 'completed',
  'attendance_confirmed': true,
  'score': 92.5,
});

Business Rules

  • Cannot enroll the same employee in the same session twice
  • Enrollment respects max_participants on the session
  • enrolled_at is auto-set on creation
  • completed_at is auto-set when status transitions to completed

Moon ERP API Documentation