41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\PredictionSource;
|
|
use App\Enums\TrendDirection;
|
|
use Database\Factories\PricePredictionFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property Carbon $predicted_for
|
|
* @property PredictionSource $source
|
|
* @property TrendDirection $direction
|
|
* @property int $confidence
|
|
* @property string|null $reasoning
|
|
* @property Carbon $generated_at
|
|
*/
|
|
#[Fillable(['predicted_for', 'source', 'direction', 'confidence', 'reasoning', 'generated_at'])]
|
|
class PricePrediction extends Model
|
|
{
|
|
/** @use HasFactory<PricePredictionFactory> */
|
|
use HasFactory;
|
|
|
|
public $timestamps = false;
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'predicted_for' => 'date',
|
|
'source' => PredictionSource::class,
|
|
'direction' => TrendDirection::class,
|
|
'confidence' => 'integer',
|
|
'generated_at' => 'datetime',
|
|
];
|
|
}
|
|
}
|