<?php

namespace App\Models;

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

class SystemAssistantLog extends Model
{
    use HasFactory;

    public $timestamps = false;

    protected $fillable = [
        'user_id',
        'session_id',
        'question',
        'request_type',
        'tool',
        'intent',
        'params_json',
        'result_summary',
        'execution_time_ms',
        'status',
        'created_at',
    ];

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

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
