<?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\MaritalStatus;

class MeritalStatusSeeder extends Seeder
{
    use DisableForeignKeys, WithoutModelEvents;

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

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

        MaritalStatus::insert([
            [
                'name'   => 'Single',
                'status' => StatusEnum::ACTIVE,
            ],
            [
                'name'   => 'Married',
                'status' => StatusEnum::ACTIVE,
            ],
            [
                'name'   => 'Divorced',
                'status' => StatusEnum::ACTIVE,
            ],
            [
                'name'   => 'Widowed',
                'status' => StatusEnum::ACTIVE,
            ],
        ]);

        $this->enableForeignKeys();
    }
}
