<?php

namespace Database\Factories;

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

class CtsSyncLogFactory extends Factory
{
    protected $model = CtsSyncLog::class;

    public function definition(): array
    {
        $status = $this->faker->randomElement(['success', 'error']);

        return [
            'synced_at' => $this->faker->dateTimeBetween('-7 days', 'now'),
            'events_count' => $this->faker->numberBetween(0, 50),
            'songs_count' => $this->faker->numberBetween(0, 200),
            'status' => $status,
            'error' => $status === 'error' ? $this->faker->sentence() : null,
        ];
    }
}
