<?php

namespace Database\Seeders;

use App\Models\AiModel;
use Illuminate\Database\Seeder;

class AiModelSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        // Für SQLite: Lösche alle existierenden Modelle und füge sie frisch ein
        AiModel::truncate();

        $data = [
            [
                'id' => 2,
                'name' => 'FLUX.1 Kontext [dev]',
                'model_type' => 'flux',
                'created_at' => '2025-07-27T20:46:32.000000',
                'updated_at' => '2025-07-28T18:07:14.000000',
                'model_id' => 'runware:106@1',
                'api_provider_id' => null, // Verwende null statt 0 oder ungültiger IDs
                'enabled' => 1,
                'parameters' => null,
            ],
            [
                'id' => 5,
                'name' => 'AbsoluteReality',
                'model_type' => 'sd1.5',
                'created_at' => '2025-07-27T20:46:32.000000',
                'updated_at' => '2025-07-27T20:46:32.000000',
                'model_id' => 'civitai:81458@256668',
                'api_provider_id' => null,
                'enabled' => 1,
                'parameters' => null,
            ],
            [
                'id' => 6,
                'name' => 'DreamShaper 8',
                'model_type' => 'sd1.5',
                'created_at' => '2025-07-27T20:46:32.000000',
                'updated_at' => '2025-07-27T20:46:32.000000',
                'model_id' => 'civitai:4384@252914',
                'api_provider_id' => null,
                'enabled' => 1,
                'parameters' => null,
            ],
            [
                'id' => 7,
                'name' => 'FLUX.1 Kontext [dev] in ComfyUI',
                'model_type' => 'flux',
                'created_at' => '2025-07-31T18:51:48.000000',
                'updated_at' => '2025-08-06T11:26:30.000000',
                'model_id' => 'flux1-kontext-dev',
                'api_provider_id' => null,
                'enabled' => 1,
                'parameters' => json_encode(['example' => 'parameter']),
            ],
            [
                'id' => 8,
                'name' => 'HiDream-I1-Dev',
                'model_type' => 'base',
                'created_at' => '2025-08-08T10:46:29.000000',
                'updated_at' => '2025-08-08T10:46:29.000000',
                'model_id' => 'runware:97@2',
                'api_provider_id' => null,
                'enabled' => 1,
                'parameters' => null,
            ],
        ];

        foreach ($data as $row) {
            AiModel::create($row);
        }
    }
}
