<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;

#[Fillable([
    'forecast_for',
    'model_version',
    'predicted_class',
    'actual_class',
    'correct',
    'abs_error_pence',
    'resolved_at',
])]
class ForecastOutcome extends Model
{
    public $timestamps = false;

    public $incrementing = false;

    protected $primaryKey = 'forecast_for';

    protected $keyType = 'string';

    protected function casts(): array
    {
        return [
            'forecast_for' => 'date',
            'correct' => 'boolean',
            'abs_error_pence' => 'integer',
            'resolved_at' => 'datetime',
        ];
    }
}
