<?php

namespace App\Models;

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

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);
    }
}
