<?php

namespace Modules\Employee\Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Modules\Core\Database\Seeders\Traits\DisableForeignKeys;
use Modules\Core\Enums\StatusEnum;
use Modules\Employee\Models\Blood;

class BloodSeeder extends Seeder
{
    use DisableForeignKeys, WithoutModelEvents;

    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $this->disableForeignKeys();

        DB::table('bloods')->truncate();

        Blood::insert([
            ['name' => 'A+', 'status' => StatusEnum::ACTIVE],
            ['name' => 'A-', 'status' => StatusEnum::ACTIVE],
            ['name' => 'B+', 'status' => StatusEnum::ACTIVE],
            ['name' => 'B-', 'status' => StatusEnum::ACTIVE],
            ['name' => 'AB+', 'status' => StatusEnum::ACTIVE],
            ['name' => 'AB-', 'status' => StatusEnum::ACTIVE],
            ['name' => 'O+', 'status' => StatusEnum::ACTIVE],
            ['name' => 'O-', 'status' => StatusEnum::ACTIVE],
        ]);

        $this->enableForeignKeys();
    }
}
