<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * @property int $id
 * @property int $schedule_id
 * @property int $provider_id
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property-read \App\Models\Provider $provider
 * @property-read \App\Models\Schedule $schedule
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal whereProviderId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal whereScheduleId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal withTrashed(bool $withTrashed = true)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ScheduleProposal withoutTrashed()
 * @mixin \Eloquent
 */
class ScheduleProposal extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'schedule_id',
        'provider_id',
    ];

    protected $casts = [
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
        'deleted_at' => 'datetime',
    ];

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

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