<?php

namespace Database\Seeders;

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

class UsernameSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        // Create a variety of usernames for testing
        Username::factory()
            ->count(15)
            ->active()
            ->public()
            ->sequence(fn ($sequence) => [
                'username' => 'public_user_'.($sequence->index + 1),
            ])
            ->create();

        Username::factory()
            ->count(10)
            ->active()
            ->premium()
            ->sequence(fn ($sequence) => [
                'username' => 'premium_user_'.($sequence->index + 1),
            ])
            ->create();

        Username::factory()
            ->count(8)
            ->active()
            ->gmail()
            ->sequence(fn ($sequence) => [
                'username' => 'gmail_user_'.($sequence->index + 1),
            ])
            ->create();

        Username::factory()
            ->count(6)
            ->active()
            ->yahoo()
            ->sequence(fn ($sequence) => [
                'username' => 'yahoo_user_'.($sequence->index + 1),
            ])
            ->create();

        Username::factory()
            ->count(6)
            ->active()
            ->outlook()
            ->sequence(fn ($sequence) => [
                'username' => 'outlook_user_'.($sequence->index + 1),
            ])
            ->create();

        Username::factory()
            ->count(4)
            ->active()
            ->custom()
            ->withExpiration()
            ->sequence(fn ($sequence) => [
                'username' => 'custom_user_'.($sequence->index + 1),
            ])
            ->create();

        // Create some inactive usernames
        Username::factory()
            ->count(5)
            ->inactive()
            ->sequence(fn ($sequence) => [
                'username' => 'inactive_user_'.($sequence->index + 1),
            ])
            ->create();

        // Create some recently used usernames
        Username::factory()
            ->count(8)
            ->active()
            ->recentlyUsed()
            ->sequence(fn ($sequence) => [
                'username' => 'recent_user_'.($sequence->index + 1),
            ])
            ->create();
    }
}
