Training Sessions (الجلسات التدريبية)
Scheduled instances of training programs with location, trainer, capacity, and status management.
Attributes
| Field | Type | Description |
|---|---|---|
id | integer | Primary key |
training_program_id | integer | Program FK |
session_date | date | Session date |
start_time | time | Start time |
end_time | time | End time |
location | string | Location (nullable) |
trainer | string | Trainer name (nullable) |
max_participants | integer | Maximum capacity (nullable) |
status | enum | scheduled, in_progress, completed, cancelled |
notes | text | Notes (nullable) |
Status Workflow
API Endpoints
| Method | URL | Description |
|---|---|---|
GET | /api/hr/training-sessions | List sessions |
POST | /api/hr/training-sessions | Create session |
GET | /api/hr/training-sessions/{id} | Show session with enrollments |
PUT | /api/hr/training-sessions/{id} | Update session |
POST | /api/hr/training-sessions/{id}/status | Change status |
Examples
bash
curl -X POST "https://moon-erp.elbaset.com/api/hr/training-sessions" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"training_program_id": 1,
"session_date": "2026-03-15",
"start_time": "09:00",
"end_time": "17:00",
"location": "Training Room A",
"trainer": "Ahmed Hassan",
"max_participants": 20
}'
# Update status
curl -X POST "https://moon-erp.elbaset.com/api/hr/training-sessions/1/status" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{ "status": "completed" }'dart
final response = await dio.post('/api/hr/training-sessions', data: {
'training_program_id': 1,
'session_date': '2026-03-15',
'start_time': '09:00',
'end_time': '17:00',
'location': 'Training Room A',
'max_participants': 20,
});Business Rules
- Show endpoint eager-loads enrollments with employee data
- Cannot exceed
max_participantswhen enrolling employees - Cancelling a session updates all enrollments to
cancelled