<?php

namespace App\Models;

use Database\Factories\BrentPriceFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

#[Fillable(['date', 'price_usd', 'prediction_generated_at'])]
class BrentPrice extends Model
{
    /** @use HasFactory<BrentPriceFactory> */
    use HasFactory;

    public $timestamps = false;

    protected $primaryKey = 'date';

    public $incrementing = false;

    protected $keyType = 'string';

    protected function casts(): array
    {
        return [
            'date' => 'date',
            'price_usd' => 'decimal:2',
            'prediction_generated_at' => 'datetime',
        ];
    }
}
