List Lessons
Отримання списку уроків з фільтрацією.
Endpoint
GET /api/v1/lessons/
Authentication
Required: Yes (Token Authentication)
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| booking_number | string | No | Фільтр по номеру бронювання |
| date | string | No | Фільтр по даті (YYYY-MM-DD) |
| status | string | No | Фільтр по статусу: active, cancelled, completed |
| skipass_number | string | No | Фільтр по номеру скіпасу |
Examples
Get all active lessons
GET /api/v1/lessons/?status=active
Get lessons for specific date
GET /api/v1/lessons/?date=2025-11-05
Get lessons by booking number
GET /api/v1/lessons/?booking_number=HMS-12345
Get lessons by skipass
GET /api/v1/lessons/?skipass_number=12-2323-2323231
Response
Success Response (200 OK)
{
"status": "success",
"count": 2,
"lessons": [
{
"id": 123,
"booking_number": "HMS-12345",
"description": "Індивідуальний урок для сім'ї",
"start_datetime": "2025-11-05T09:00:00Z",
"end_datetime": "2025-11-05T15:00:00Z",
"instructor_name": "Петро Іванович",
"location": "Буковель-1",
"status": "active",
"participants": [
{
"id": 456,
"customer": {
"name": "Іван",
"surname": "Петренко",
"phone_number": "+380501234567",
"email_adress": "ivan@example.com"
},
"notes": "Досвідчений лижник",
"skipasses": [
{
"id": 789,
"skipass_number": "12-2323-2323231",
"valid_from": "2025-11-05T09:00:00Z",
"valid_until": "2025-11-05T12:00:00Z",
"skipass_type": "3-годинний",
"skipass_price": "100.00",
"skipass_category": "Дорослий",
"notes": "Перша половина дня"
}
]
}
],
"created_at": "2025-11-03T12:00:00Z",
"updated_at": "2025-11-03T12:00:00Z"
},
{
"id": 124,
"booking_number": "HMS-12346",
"description": "Груповий урок",
"start_datetime": "2025-11-05T10:00:00Z",
"end_datetime": "2025-11-05T13:00:00Z",
"instructor_name": "Ольга Сергіївна",
"location": "Буковель-2",
"status": "active",
"participants": [],
"created_at": "2025-11-03T13:00:00Z",
"updated_at": "2025-11-03T13:00:00Z"
}
]
}
Error Response (400 BAD REQUEST)
{
"error": "Invalid date format. Use YYYY-MM-DD"
}
Notes
- Результат відсортований за датою створення
- Якщо не вказано фільтри, повертаються всі уроки (без прив'язки до старих курсів)
- Фільтр
dateшукає уроки, які перетинаються з вказаною датою - Фільтр
skipass_numberшукає через всіх учасників та їх скіпаси
Example cURL
# Get all lessons for today
curl -X GET "https://bukovelvipentry.breport.site/api/v1/lessons/?date=2025-11-05" \
-H "Authorization: Token YOUR_TOKEN"
# Get lessons by booking number
curl -X GET "https://bukovelvipentry.breport.site/api/v1/lessons/?booking_number=HMS-12345" \
-H "Authorization: Token YOUR_TOKEN"
# Get active lessons with specific skipass
curl -X GET "https://bukovelvipentry.breport.site/api/v1/lessons/?status=active&skipass_number=12-2323-2323231" \
-H "Authorization: Token YOUR_TOKEN"