<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class AvailabilityRule extends Model
{
    use HasFactory;

    protected $fillable = [
        'available_id',
        'available_type',
        'rule_mode',
        'pattern_type',
        'start_date',
        'end_date',
        'day_of_week',
        'day_of_month',
        'month_of_year',
        'message',
        'valid_from',
        'valid_until',
    ];

    public function available()
    {
        return $this->morphTo();
    }
}
