<?php

namespace Database\Seeders;

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

/** Documents an applicant must supply (PRD 17). Administrators can change these. */
class DocumentTypeSeeder extends Seeder
{
    public function run(): void
    {
        $types = [
            [
                'name' => 'Academic Transcript / Certificate',
                'slug' => 'academic-certificate',
                'description' => 'Your UACE, UCE, diploma or degree certificate and transcript.',
                'is_required' => true,
            ],
            [
                'name' => 'Passport Photograph',
                'slug' => 'passport-photo',
                'description' => 'A recent colour passport-size photograph on a plain background.',
                'is_required' => true,
                'allowed_mimes' => ['jpg', 'jpeg', 'png'],
                'max_size_kb' => 2048,
            ],
            [
                'name' => 'National ID or Passport',
                'slug' => 'national-id',
                'description' => 'A clear copy of your national identity card or passport bio-data page.',
                'is_required' => true,
            ],
            [
                'name' => 'Birth Certificate',
                'slug' => 'birth-certificate',
                'description' => 'Required where your identity document does not show your date of birth.',
                'is_required' => false,
            ],
            [
                'name' => 'Other Supporting Document',
                'slug' => 'supporting-document',
                'description' => 'Any additional evidence supporting your application.',
                'is_required' => false,
            ],
        ];

        foreach ($types as $order => $type) {
            DocumentType::updateOrCreate(['slug' => $type['slug']], $type + [
                'status' => 'active',
                'sort_order' => $order + 1,
            ]);
        }

        $this->command?->info('Seeded '.count($types).' document types.');
    }
}
