<?php

namespace Database\Factories;

use App\Models\ArchiveSetting;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<ArchiveSetting>
 */
class ArchiveSettingFactory extends Factory
{
    protected $model = ArchiveSetting::class;

    public function definition(): array
    {
        return [
            'action_id' => null,
            'decision_id' => null,
            'segment_id' => null,
            'entities' => [
                [
                    'table' => 'documents',
                    'conditions' => [
                        'older_than_days' => $this->faker->numberBetween(30, 365),
                    ],
                    'columns' => ['id', 'deleted_at'],
                ],
            ],
            'name' => $this->faker->sentence(3),
            'description' => $this->faker->optional()->paragraph(),
            'enabled' => true,
            'strategy' => 'immediate',
            'soft' => true,
            'options' => [
                'batch_size' => $this->faker->numberBetween(50, 500),
            ],
            'created_by' => User::query()->inRandomOrder()->value('id'),
            'updated_by' => null,
        ];
    }
}
