<?php

declare(strict_types=1);

namespace Database\Factories;

use App\Enums\AuditAction;
use App\Models\AuditLog;
use App\Models\Member;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<AuditLog>
 */
class AuditLogFactory extends Factory
{
    public function definition(): array
    {
        return [
            'user_id' => User::factory(),
            'action' => fake()->randomElement(AuditAction::cases()),
            'auditable_type' => Member::class,
            'auditable_id' => Member::factory(),
            'old_values' => null,
            'new_values' => null,
            'ip_address' => fake()->ipv4(),
        ];
    }
}
