<?php

namespace Database\Seeders;

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

class TierSeeder extends Seeder
{
    public function run(): void
    {
        $tiers = [
            [
                'name'                    => 'Invited',
                'slug'                    => 'invited',
                'min_spend_per_visit'     => 100.00,
                'visit_frequency_months'  => 3,
                'visits_per_period'       => 1,
                'points_threshold_3months' => 250,
                'display_order'           => 1,
                'color_class'             => 'tier-invited',
            ],
            [
                'name'                    => 'Indulged',
                'slug'                    => 'indulged',
                'min_spend_per_visit'     => 150.00,
                'visit_frequency_months'  => 1,
                'visits_per_period'       => 1,
                'points_threshold_3months' => 500,
                'display_order'           => 2,
                'color_class'             => 'tier-indulged',
            ],
            [
                'name'                    => 'Limitless',
                'slug'                    => 'limitless',
                'min_spend_per_visit'     => 200.00,
                'visit_frequency_months'  => 1,
                'visits_per_period'       => 2,
                'points_threshold_3months' => 1000,
                'display_order'           => 3,
                'color_class'             => 'tier-limitless',
            ],
        ];

        foreach ($tiers as $tier) {
            Tier::updateOrCreate(['slug' => $tier['slug']], $tier);
        }
    }
}
