<?php

namespace Database\Factories;

use App\Domain\Documents\Enums\DocumentCategory;
use App\Domain\Organization\Models\Company;
use Illuminate\Database\Eloquent\Factories\Factory;

class DocumentTypeFactory extends Factory
{
    public function definition(): array
    {
        return [
            'company_id' => Company::factory(),
            'code' => $this->faker->unique()->slug(2),
            'name' => $this->faker->words(2, true),
            'category' => DocumentCategory::Identity->value,
            'is_sensitive' => false,
            'requires_number' => false,
            'requires_issue_date' => false,
            'requires_expiry_date' => false,
            'max_file_size_kb' => 10240,
            'is_active' => true,
            'sort_order' => 100,
        ];
    }

    public function sensitive(): static
    {
        return $this->state(fn () => ['is_sensitive' => true]);
    }

    public function requiringExpiry(): static
    {
        return $this->state(fn () => ['requires_expiry_date' => true]);
    }
}
