35 lines
962 B
PHP
35 lines
962 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\PredictionSource;
|
|
use App\Enums\TrendDirection;
|
|
use App\Models\PricePrediction;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/** @extends Factory<PricePrediction> */
|
|
class PricePredictionFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'predicted_for' => fake()->dateTimeBetween('-30 days')->format('Y-m-d'),
|
|
'source' => fake()->randomElement(PredictionSource::cases()),
|
|
'direction' => fake()->randomElement(TrendDirection::cases()),
|
|
'confidence' => fake()->numberBetween(40, 85),
|
|
'reasoning' => fake()->sentence(12),
|
|
'generated_at' => now(),
|
|
];
|
|
}
|
|
|
|
public function llm(): static
|
|
{
|
|
return $this->state(['source' => PredictionSource::Llm]);
|
|
}
|
|
|
|
public function ewma(): static
|
|
{
|
|
return $this->state(['source' => PredictionSource::Ewma]);
|
|
}
|
|
}
|