<?php

namespace App\Domains\AI\Models;

use App\Domains\Tenancy\Models\Tenant;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class TenantAiSetting extends Model
{
    use HasFactory;
    use HasUuids;

    protected $fillable = [
        'tenant_id',
        'ai_enabled',
        'allowed_features',
        'default_language',
        'tone_style',
        'max_daily_ai_requests',
        'human_approval_required',
        'ai_data_retention_days',
        'model_override',
    ];

    protected $casts = [
        'ai_enabled' => 'boolean',
        'allowed_features' => 'array',
        'human_approval_required' => 'boolean',
    ];

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