<?php

namespace Database\Factories;

use App\Models\BackupSet;
use App\Models\Policy;
use App\Models\ManagedEnvironment;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\BackupItem>
 */
class BackupItemFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'managed_environment_id' => ManagedEnvironment::factory(),
            'backup_set_id' => BackupSet::factory(),
            'policy_id' => Policy::factory(),
            'policy_identifier' => fake()->uuid(),
            'policy_type' => 'settingsCatalogPolicy',
            'platform' => fake()->randomElement(['android', 'iOS', 'macOS', 'windows10']),
            'captured_at' => now(),
            'payload' => ['id' => fake()->uuid(), 'name' => fake()->words(3, true)],
            'metadata' => ['policy_name' => fake()->words(3, true)],
            'assignments' => null,
        ];
    }
}
