<?php

namespace Database\Seeders;

use App\Models\DocumentType;
use Illuminate\Database\Seeder;

class DocumentTypeSeeder extends Seeder
{
    public function run(): void
    {
        $types = [
            ['name' => 'PDF Document',        'slug' => 'pdf',        'sorting' => 1,  'is_active' => true],
            ['name' => 'Word Document',        'slug' => 'word',       'sorting' => 2,  'is_active' => true],
            ['name' => 'Excel Spreadsheet',   'slug' => 'excel',      'sorting' => 3,  'is_active' => true],
            ['name' => 'PowerPoint',          'slug' => 'powerpoint', 'sorting' => 4,  'is_active' => true],
            ['name' => 'Image',               'slug' => 'image',      'sorting' => 5,  'is_active' => true],
            ['name' => 'Text File',           'slug' => 'text',       'sorting' => 6,  'is_active' => true],
            ['name' => 'CSV File',            'slug' => 'csv',        'sorting' => 7,  'is_active' => true],
            ['name' => 'ZIP Archive',         'slug' => 'zip',        'sorting' => 8,  'is_active' => true],
            ['name' => 'Other',               'slug' => 'other',      'sorting' => 99, 'is_active' => true],
        ];

        foreach ($types as $type) {
            DocumentType::updateOrCreate(['slug' => $type['slug']], $type);
        }
    }
}
