<?php

namespace App\Models;

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

class ProviderWorkingDay extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = [
        'provider_id',
        'day',
        'period',
    ];

    protected $casts = [
        'day' => 'integer',
        'period' => WorkingPeriodEnum::class,
    ];

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