<?php

namespace Database\Seeders;

use App\Models\DealStage;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class DealStageSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $stages = [
            'New',
            'Proposal',
            'Quotation',
            'Presentation',
            'Demo',
            'Negotiation',
            'Review',
            'Awaiting Decision',
            'Closed Won',
            'Closed Lost',
        ];

        foreach ($stages as $index => $stage) {
            DB::table('deal_stages')->updateOrInsert(
                ['id' => $index + 1],
                ['name' => $stage, 'updated_at' => now(), 'created_at' => now()]
            );
        }
    }
}
