<?php

namespace App\Models;

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

/**
 * @property int $id
 * @property int $review_id
 * @property int $improvement_type_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\ImprovementType $improvementType
 * @property-read \App\Models\Review $review
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement whereImprovementTypeId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement whereReviewId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement withTrashed(bool $withTrashed = true)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewImprovement withoutTrashed()
 * @mixin \Eloquent
 */
class ReviewImprovement extends Model
{
    use HasFactory, SoftDeletes;

    protected $table = 'reviews_improvements';

    protected $fillable = [
        'review_id',
        'improvement_type_id',
    ];

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

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

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