<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class AttendanceSettingSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $settings = [
            'manual_entry_enabled' => '1',
            'manual_attendance_enabled' => '1',
            'auto_approve_attendance' => '0',
            'monthly_attendance_goal' => '160',
            'shift_start_time' => '09:00',
            'shift_end_time' => '18:00',
        ];

        foreach ($settings as $key => $value) {
            \App\Models\BusinessSetting::updateOrCreate(
                ['key' => $key],
                ['value' => $value, 'type' => 'attendance']
            );
        }

        \Illuminate\Support\Facades\Cache::forget('business_settings_all');
    }
}
