<?php

namespace Database\Seeders;

use App\Models\Alert;
use App\Models\User;
use Illuminate\Database\Seeder;

class AlertSeeder extends Seeder
{
    public function run(): void
    {
        $citizen = User::where('role', 'user')->first();

        if (!$citizen) return;

        // Active Alert featuring an optimized media file link placeholder configuration path
        Alert::create([
            'user_id'    => $citizen->id,
            'latitude'   => 4.815621,
            'longitude'  => 6.912344,
            'status'     => 'active',
            'video_path' => 'incidents/sample_panic_log.mp4',
            'tagged_at'  => now(),
        ]);

        // Older alert already flagged resolved on command boards
        Alert::create([
            'user_id'    => $citizen->id,
            'latitude'   => 4.821045,
            'longitude'  => 6.923012,
            'status'     => 'resolved',
            'video_path' => null,
            'tagged_at'  => now()->subHours(5),
        ]);
    }
}
