<?php

namespace Database\Factories;

use App\Models\AssetCategory;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Asset>
 */
class AssetFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'category_id' => AssetCategory::factory(),
            'name' => $this->faker->word(),
            'serial_number' => $this->faker->unique()->bothify('SN-####-????'),
            'purchase_date' => $this->faker->date(),
            'warranty_expiry' => $this->faker->dateTimeBetween('now', '+2 years')->format('Y-m-d'),
            'condition' => $this->faker->randomElement(['new', 'good', 'damaged']),
            'status' => $this->faker->randomElement(['available', 'assigned', 'maintenance', 'retired']),
        ];
    }
}
