<?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;

class TaskPrediction extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = ['task_id', 'prediction_type', 'score', 'risk_level', 'reason', 'predicted_at'];

    protected function casts(): array
    {
        return ['predicted_at' => 'datetime'];
    }

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