Add InstructorAvailabilityService with vacation, units limits, break rules

- InstructorAvailabilityService checks:
  1. Vacation (instructor_vacations table)
  2. Regular availability (instructor_availability weekday/time windows)
  3. Daily units limit (max_daily_units + max_daily_override)
  4. Weekly units limit (max_weekly_units + max_weekly_override)
  5. Break rules (between appointments, continuous minutes)

- AppointmentsController now uses availabilityService
- Fixed getQueryParam() -> getQueryParams() compatibility
- Instructor model updated with max_*_units fields
This commit is contained in:
Hermes Agent
2026-05-20 22:50:26 +02:00
parent f68400e282
commit 5f753c15df
3 changed files with 286 additions and 3 deletions

View File

@@ -13,8 +13,17 @@ final class Instructor extends Model
protected $fillable = [
'tenant_id', 'user_id', 'first_name', 'last_name',
'color', 'notes', 'is_active', 'pre_start_buffer_minutes',
'max_daily_units', 'max_daily_override',
'max_weekly_units', 'max_weekly_override',
];
protected $casts = [
'is_active' => 'integer',
'tenant_id' => 'integer',
'max_daily_units' => 'integer',
'max_daily_override' => 'integer',
'max_weekly_units' => 'integer',
'max_weekly_override' => 'integer',
];
protected $casts = ['is_active' => 'integer', 'tenant_id' => 'integer'];
public function tenant(): BelongsTo
{