<?php

namespace App\Models;

use App\Enums\BlockedPeriodEnum;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

class ProviderBlockedDay extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = [
        'provider_id',
        'date',
        'period',
        'reason',
        'init_hour',
        'end_hour',
    ];

    protected $casts = [
        'date' => 'date',
        'period' => BlockedPeriodEnum::class,
    ];

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