<?php

namespace App\Domain\HR\Models;

use App\Domain\HR\Enums\AvailabilityType;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class TrainerAvailability extends Model
{
    public $timestamps = false;

    const CREATED_AT = 'created_at';
    const UPDATED_AT = null;

    protected $table = 'trainer_availability';

    protected $fillable = [
        'trainer_id',
        'type',
        'day_of_week',
        'specific_date',
        'start_time',
        'end_time',
        'reason',
    ];

    protected $casts = [
        'type' => AvailabilityType::class,
        'specific_date' => 'date',
        'day_of_week' => 'integer',
    ];

    // --- Relationships ---

    public function trainer(): BelongsTo
    {
        return $this->belongsTo(Trainer::class);
    }
}
