<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class EconomicScenario extends Model
{
    use HasFactory;

    protected $fillable = [
        'user_id',
        'name',
        'sale_price_crc_per_kg',
        'expected_mortality_pct',
        'feed_cost_variation_pct',
        'energy_cost_variation_pct',
        'growth_variation_pct',
        'result',
    ];

    protected $casts = [
        'result' => 'array',
    ];

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}
