feat: add HasFactory and factories for ApiLog, BrentPrice, PricePrediction
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
34
database/factories/PricePredictionFactory.php
Normal file
34
database/factories/PricePredictionFactory.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user