<?php

namespace Database\Seeders;

use App\Models\Contact;
use App\Models\Registration;
use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class DatabaseSeeder extends Seeder
{
    public function run(): void
    {
        // Default admin
        User::updateOrCreate(
            ['email' => env('ADMIN_EMAIL', 'admin@fashiongrace.com')],
            [
                'name' => 'Fashion Grace Admin',
                'password' => Hash::make(env('ADMIN_PASSWORD', 'password')),
            ]
        );

        // Sample registrations
        $samples = [
            ['name' => 'Priya Sharma', 'age' => 22, 'height' => "5'6\"", 'complexion' => 'Fair', 'weight' => 54, 'city' => 'New Delhi', 'contact' => '9876543210', 'category' => 'Beauty Pageant', 'about' => 'Aspiring model and pageant contestant.', 'status' => 'pending'],
            ['name' => 'Ananya Roy', 'age' => 25, 'height' => "5'8\"", 'complexion' => 'Wheatish', 'weight' => 58, 'city' => 'Kolkata', 'contact' => '9123456780', 'category' => 'Fashion Show', 'about' => 'Runway model with 2 years experience.', 'status' => 'shortlisted'],
            ['name' => 'Meera Nair', 'age' => 20, 'height' => "5'5\"", 'complexion' => 'Dusky', 'weight' => 52, 'city' => 'Mumbai', 'contact' => '9988776655', 'category' => 'Beauty Pageant', 'about' => 'Trained classical dancer.', 'status' => 'approved'],
        ];
        foreach ($samples as $s) {
            Registration::create($s);
        }

        Contact::create([
            'name' => 'Rahul Verma',
            'email' => 'rahul@example.com',
            'message' => 'Hi, I would like to know more about the upcoming fashion show auditions.',
            'is_read' => false,
        ]);
    }
}
