<?php

namespace Database\Seeders;

use App\Models\Device;
use App\Models\DeviceSchedule;
use Illuminate\Database\Seeder;

class DeviceSeeder extends Seeder
{
    public function run(): void
    {
        $devices = [
            [
                'name'       => 'LIS 1',
                'ip_address' => '49.124.159.170',
                'port'       => 9527,
                'width_px'   => 104,
                'height_px'  => 208,
                'location'   => 'Main Gate',
                'is_active'  => true,
            ],
            [
                'name'       => 'LIS 8.15NB',
                'ip_address' => '49.124.159.171',
                'port'       => 9527,
                'width_px'   => 104,
                'height_px'  => 208,
                'location'   => 'Side Gate',
                'is_active'  => true,
            ],
        ];

        foreach ($devices as $d) {
            $device = Device::create($d);
            DeviceSchedule::create(['device_id' => $device->id]);
        }
    }
}
