<?php

namespace Database\Seeders;

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

class PackageAddonSeeder extends Seeder
{
    public function run(): void
    {
        $addons = [
            [
                'key' => 'extra_photos_500',
                'label' => '+500 Fotos',
                'price_id' => null,
                'extra_photos' => 500,
                'extra_guests' => 0,
                'extra_gallery_days' => 0,
                'active' => true,
                'sort' => 10,
                'metadata' => ['price_eur' => 5],
            ],
            [
                'key' => 'extra_photos_2000',
                'label' => '+2.000 Fotos',
                'price_id' => null,
                'extra_photos' => 2000,
                'extra_guests' => 0,
                'extra_gallery_days' => 0,
                'active' => true,
                'sort' => 11,
                'metadata' => ['price_eur' => 12],
            ],
            [
                'key' => 'extra_photos_5000',
                'label' => '+5.000 Fotos',
                'price_id' => null,
                'extra_photos' => 5000,
                'extra_guests' => 0,
                'extra_gallery_days' => 0,
                'active' => true,
                'sort' => 12,
                'metadata' => ['price_eur' => 25],
            ],
            [
                'key' => 'extra_guests_50',
                'label' => '+50 Gäste',
                'price_id' => null,
                'extra_photos' => 0,
                'extra_guests' => 50,
                'extra_gallery_days' => 0,
                'active' => true,
                'sort' => 18,
                'metadata' => ['price_eur' => 3],
            ],
            [
                'key' => 'extra_guests_100',
                'label' => '+100 Gäste',
                'price_id' => null,
                'extra_photos' => 0,
                'extra_guests' => 100,
                'extra_gallery_days' => 0,
                'active' => true,
                'sort' => 19,
                'metadata' => ['price_eur' => 5],
            ],
            [
                'key' => 'extra_guests_300',
                'label' => '+300 Gäste',
                'price_id' => null,
                'extra_photos' => 0,
                'extra_guests' => 300,
                'extra_gallery_days' => 0,
                'active' => true,
                'sort' => 20,
                'metadata' => ['price_eur' => 12],
            ],
            [
                'key' => 'extend_gallery_30d',
                'label' => 'Galerie +30 Tage',
                'price_id' => null,
                'extra_photos' => 0,
                'extra_guests' => 0,
                'extra_gallery_days' => 30,
                'active' => true,
                'sort' => 30,
                'metadata' => ['price_eur' => 4],
            ],
            [
                'key' => 'extend_gallery_90d',
                'label' => 'Galerie +90 Tage',
                'price_id' => null,
                'extra_photos' => 0,
                'extra_guests' => 0,
                'extra_gallery_days' => 90,
                'active' => true,
                'sort' => 31,
                'metadata' => ['price_eur' => 10],
            ],
            [
                'key' => 'extend_gallery_180d',
                'label' => 'Galerie +180 Tage',
                'price_id' => null,
                'extra_photos' => 0,
                'extra_guests' => 0,
                'extra_gallery_days' => 180,
                'active' => true,
                'sort' => 32,
                'metadata' => ['price_eur' => 20],
            ],
            [
                'key' => 'event_boost_medium',
                'label' => 'Event-Boost (100 Gäste, 2.000 Fotos, +30 Tage)',
                'price_id' => null,
                'extra_photos' => 2000,
                'extra_guests' => 100,
                'extra_gallery_days' => 30,
                'active' => true,
                'sort' => 40,
                'metadata' => ['price_eur' => 18],
            ],
            [
                'key' => 'event_boost_large',
                'label' => 'Event-Boost (300 Gäste, 5.000 Fotos, +90 Tage)',
                'price_id' => null,
                'extra_photos' => 5000,
                'extra_guests' => 300,
                'extra_gallery_days' => 90,
                'active' => true,
                'sort' => 41,
                'metadata' => ['price_eur' => 38],
            ],
        ];

        foreach ($addons as $addon) {
            PackageAddon::updateOrCreate(
                ['key' => $addon['key']],
                $addon,
            );
        }
    }
}
