<?php

namespace App\Domains\AI\Actions;

use App\Domains\AI\Models\TenantAiSetting;
use App\Domains\Tenancy\Models\Tenant;

class CreateDefaultAiSettingsAction
{
    public function execute(Tenant $tenant): TenantAiSetting
    {
        return TenantAiSetting::query()->firstOrCreate(
            ['tenant_id' => $tenant->getKey()],
            [
                'ai_enabled' => true,
                'allowed_features' => config('ai.feature_defaults'),
                'default_language' => 'en',
                'tone_style' => 'professional',
                'human_approval_required' => true,
            ]
        );
    }
}
