<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Hidden;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;

/**
 * @property int $id
 * @property string $provider
 * @property string|null $api_key
 * @property string $model
 * @property bool $enabled
 * @property Carbon|null $last_tested_at
 * @property string|null $last_status
 */
#[Fillable(['provider', 'api_key', 'model', 'enabled', 'last_tested_at', 'last_status'])]
#[Hidden(['api_key'])]
class AiIntegration extends Model
{
    /**
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'api_key' => 'encrypted',
            'enabled' => 'boolean',
            'last_tested_at' => 'datetime',
        ];
    }
}
