<?php

namespace Database\Seeders\Dummy;

use App\Models\Tenants\WorkSetting;
use Database\Seeders\DummyDataSeeder;
use Illuminate\Database\Seeder;

class DummyWorkSettingSeeder extends Seeder
{
    public function run(): void
    {
        $tenantId = DummyDataSeeder::TENANT_ID;
        $userId = DummyDataSeeder::USER_ID;

        // 기존 설정이 있으면 스킵
        $existing = WorkSetting::where('tenant_id', $tenantId)->first();
        if ($existing) {
            $this->command->info('   ⚠ work_settings: 이미 존재 (스킵)');

            return;
        }

        WorkSetting::create([
            'tenant_id' => $tenantId,
            'work_type' => 'fixed',
            'standard_hours' => 8,
            'overtime_hours' => 4,
            'overtime_limit' => 52,
            'work_days' => [1, 2, 3, 4, 5], // 월~금
            'start_time' => '09:00:00',
            'end_time' => '18:00:00',
            'break_minutes' => 60,
            'break_start' => '12:00:00',
            'break_end' => '13:00:00',
        ]);

        $this->command->info('   ✓ work_settings: 1건 생성');
    }
}
