<?php

namespace Database\Factories;

use App\Models\PushDevice;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

/** @extends Factory<PushDevice> */
class PushDeviceFactory extends Factory
{
    protected $model = PushDevice::class;

    public function definition(): array
    {
        $token = Str::random(180);

        return [
            'uuid' => (string) Str::uuid(),
            'user_id' => User::factory(),
            'platform' => fake()->randomElement(['android', 'ios']),
            'device_token' => $token,
            'device_token_hash' => hash('sha256', $token),
            'app_version' => '1.0.0',
            'os_version' => '15',
            'locale' => 'en',
            'timezone' => 'Asia/Kolkata',
            'last_active' => now(),
            'status' => 'active',
            'token_refreshed_at' => now(),
        ];
    }
}
