<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ExternalBusyWindow extends Model
{
    protected $fillable = [
        'external_calendar_id', 'starts_at', 'ends_at',
        'transparency', 'last_seen_at'
    ];

    protected $casts = [
        'starts_at' => 'datetime',
        'ends_at' => 'datetime',
        'last_seen_at' => 'datetime',
    ];

    public function calendar()
    {
        return $this->belongsTo(ExternalCalendar::class, 'external_calendar_id');
    }
}