Check available times
AvailabilityService::getAvailableTimes()
Parameters
| Parameter | Type | Description |
|---|---|---|
teach_id | int | The teach record to check availability for |
date | date | Date to check |
duration | int | Desired lesson duration (minutes) |
lesson_type | int | 1=tutor’s home, 2=student’s home, 3=online |
post_code | string | Student’s postcode (for travel time calculation) |
utc_offset | int | Client timezone offset |
Response
ViaAvailableTimesTransformer:
How availability is calculated
- Gets tutor’s
DayAvailabilityfor the requested day of week - Generates 15-minute interval time slots
- Filters out clashing lessons — checks existing lessons on that date
- Filters out calendar events — checks Google Calendar if connected
- Applies travel time buffers — for in-person lessons, uses BlackBox service to calculate transit time between locations
- Validates postcode — for student’s home lessons, validates the student’s postcode is within tutor’s travel distance
- Converts times based on UTC offset
Legacy availability search
auth:api
Similar functionality with slightly different parameters.
Day availability management (tutor-side)
Tutors manage their weekly schedule:auth:api
Each day availability record defines:
- Day — day of week (mapped to generic dates internally)
- Time slots — from/to times within that day
- Lesson types — which lesson types are available (online, tutor’s home, student’s home)
- Buffer duration — travel time buffer between lessons
Day constants
Defined inDayAvailability model:
| Day | Generic date mapping |
|---|---|
| SUNDAY | Maps to a fixed reference date |
| MONDAY | Maps to a fixed reference date |
| … | … |
| SATURDAY | Maps to a fixed reference date |