<?php

namespace Modules\Billing\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\Billing\Models\ServiceDepartment;
use Modules\Core\Enums\StatusEnum;

class ServiceDepartmentSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $departments = [
            [
                'name' => 'Consultation',
                'code' => 'CONS',
                'description' => 'Doctor consultation and follow-up services',
            ],
            [
                'name' => 'Pathology',
                'code' => 'PATH',
                'description' => 'Laboratory and diagnostic pathology services',
            ],
            [
                'name' => 'Radiology',
                'code' => 'RAD',
                'description' => 'Radiology and imaging services',
            ],
            [
                'name' => 'Blood Bank',
                'code' => 'BB',
                'description' => 'Blood transfusion and blood bank services',
            ],
            [
                'name' => 'Procedure',
                'code' => 'PROC',
                'description' => 'Clinical procedures and treatment services',
            ],
            [
                'name' => 'Bed & Cabin',
                'code' => 'BED',
                'description' => 'Bed, cabin and admission related services',
            ],
            [
                'name' => 'General Services',
                'code' => 'GEN',
                'description' => 'General hospital and administrative services',
            ],
        ];

        foreach ($departments as $department) {
            ServiceDepartment::updateOrCreate(
                [
                    'code' => $department['code'],
                ],
                [
                    'name'        => $department['name'],
                    'description' => $department['description'],
                    'status'      => StatusEnum::ACTIVE,
                ]
            );
        }
    }
}
