<?php

namespace Database\Seeders;

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

class AvatarSeeder extends Seeder
{
    public function run(): void
    {
        $avatars = [
            ['name' => 'Default ViZuTrade Avatar', 'image_path' => 'images/avatars/default-avatar.png', 'is_default' => true],
            ['name' => 'Trader Blue', 'image_path' => 'images/avatars/trader-blue.png', 'is_default' => false],
            ['name' => 'Trader Green', 'image_path' => 'images/avatars/trader-green.png', 'is_default' => false],
            ['name' => 'Trader Gold', 'image_path' => 'images/avatars/trader-gold.png', 'is_default' => false],
            ['name' => 'Trader Dark', 'image_path' => 'images/avatars/trader-dark.png', 'is_default' => false],
            ['name' => 'Trader Female Blue', 'image_path' => 'images/avatars/trader-female-blue.png', 'is_default' => false],
            ['name' => 'Trader Female Gold', 'image_path' => 'images/avatars/trader-female-gold.png', 'is_default' => false],
        ];

        foreach ($avatars as $avatar) {
            Avatar::updateOrCreate(
                ['image_path' => $avatar['image_path']],
                [
                    'name' => $avatar['name'],
                    'status' => Avatar::STATUS_ACTIVE,
                    'is_default' => $avatar['is_default'],
                ],
            );
        }
    }
}
