<?php

namespace Database\Seeders;

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

class ShiftSeeder extends Seeder
{
    public function run(): void
    {
        $shifts = [
            [
                'name' => 'Shift Guru & Staf TU',
                'type' => 'guru',
                'start_time' => '07:00:00',
                'end_time' => '15:30:00',
                'grace_period_minutes' => 15,
                'late_tolerance_minutes' => 15,
            ],
            [
                'name' => 'Shift Siswa Reguler',
                'type' => 'siswa',
                'start_time' => '07:00:00',
                'end_time' => '15:00:00',
                'grace_period_minutes' => 15,
                'late_tolerance_minutes' => 15,
            ],
            [
                'name' => 'Shift Siswa Jumat',
                'type' => 'siswa',
                'start_time' => '07:00:00',
                'end_time' => '11:30:00',
                'grace_period_minutes' => 15,
                'late_tolerance_minutes' => 15,
            ],
        ];

        foreach ($shifts as $shift) {
            Shift::updateOrCreate(['name' => $shift['name']], $shift);
        }
    }
}
