<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\Promo;
use Illuminate\Support\Str;

class PromoSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $promos = [
            [
                'title' => 'Welcome Discount',
                'code' => 'WELCOME10',
                'discount' => 10,
                'eligible_cars' => [],
                'expiration_date' => now()->addDays(30),
                'is_active' => true,
                'usage_limit' => 100,
                'times_used' => 0,
            ],
            [
                'title' => 'Spring Sale',
                'code' => 'SPRING20',
                'discount' => 20,
                'eligible_cars' => [],
                'expiration_date' => now()->addDays(60),
                'is_active' => true,
                'usage_limit' => 50,
                'times_used' => 0,
            ],
            [
                'title' => 'Lainay Offer',
                'code' => 'LAINAY2025',
                'discount' => 30,
                'eligible_cars' => [],
                'expiration_date' => now()->addDays(90),
                'is_active' => true,
                'usage_limit' => 10,
                'times_used' => 0,
            ],
            [
                'title' => 'Holiday Special',
                'code' => 'HOLIDAY15',
                'discount' => 15,
                'eligible_cars' => [],
                'expiration_date' => now()->addDays(45),
                'is_active' => true,
                'usage_limit' => 200,
                'times_used' => 0,
            ],
            [
                'title' => 'Super Saver',
                'code' => 'SAVE30',
                'discount' => 30,
                'eligible_cars' => [],
                'expiration_date' => now()->addDays(20),
                'is_active' => true,
                'usage_limit' => 300,
                'times_used' => 0,
            ],
        ];

        foreach ($promos as $promo) {
            Promo::create($promo);
        }
    }
}
